简体   繁体   中英

How do I style the Codename One Calendar?

I'm trying to get the Codename One Calendar to look like this:

在此处输入图片说明

Instead of like this:

在此处输入图片说明

How do I go about doing this?

I looked at the API but there is no direct equivalent for setting the button colors or title colors and couldn't find a way to change the Sun, Mon etc. strings.

Should style CalendarDay in the designer to have the look you want: Font, padding etc.

The CalendarTitle UIID can be styled with blue to represent the colors.

To do this double click the theme.res and select the "Theme", press "Add" and type in either CalendarDay or CalendarTitle . Proceed to derive or override as necessary to produce the desired look. See this for more information: https://www.codenameone.com/how-do-i---create-a-simple-theme.html

To localize the titles define your own localization bundle as explained here: https://www.codenameone.com/how-do-i---localizetranslate-my-application-apply-i18nl10n-internationalizationlocalization-to-my-app.html

Use the resource bundle keys: Calendar.Sunday, Calendar.Monday etc...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM