command and picker

31 views
Skip to first unread message

Sam Ace

unread,
Aug 26, 2014, 7:15:49 AM8/26/14
to codenameone...@googlegroups.com
hi how can i style the sidecommand icon? want to set its background for unselected,selected,and pressed..
 and how can i add a comand to buttom of side bar? and how can i get year from Picker?

Diamond

unread,
Aug 26, 2014, 7:36:08 AM8/26/14
to codenameone...@googlegroups.com
MenuButton can be  used to style Sidecommand Icon in GUI Builder. I have no idea of how you can add a command at the bottom of a side bar.

You may try setting the top margin of that command to device height minus ( - ) it's height (including it's top and bottom margin) only if its the only command on the side menu. 

Diamond. 

Sam Ace

unread,
Aug 26, 2014, 8:11:24 AM8/26/14
to codenameone...@googlegroups.com
ok thanks.. styling works but i have some Commands placed on my sidemenu already.. i just want to add another command to the south of the form. do you know how i can achieve this? and is there anyway i can get Year from Picker?

Diamond

unread,
Aug 26, 2014, 9:21:12 AM8/26/14
to codenameone...@googlegroups.com
        //set the picker type to date as follows
        Picker p = new Picker();   // or Picker p = findPickerYear();
        p.setType(Display.PICKER_TYPE_DATE);


        // get your year as follows
        String date = p.getDate() + "";
        String Year = date.substring(date.length() - 4, date.length());

Note that getting year should happen inside an Event Listener
 

Sam Ace

unread,
Aug 26, 2014, 9:49:18 AM8/26/14
to codenameone...@googlegroups.com
Thanks also tried something like this and it works...
SimpleDateFormater sf = new SimpleDateFormat("y");
sf.format(picker.getDate()); ...

do you know how i can add a command to the south/buttom of sideMenu?
Reply all
Reply to author
Forward
0 new messages