HorizontalTabTitleView
Hello
I am very new to blackberry programming. I picked it up just so that I could make my own applications. I started with 6.0. I was trying to make the tabs; However, I couldn't find examples of this new way of doing tabs. Can someone help me with an example or a better explanation on how to use that API. Thank you.
Thank you
In fact, I found this post. I'll try that if I couldn't understand the HorizontalTabTitleView. http://docs.BlackBerry.com/en/developers/deliverables/18091/BlackBerry_Java_SDK-New_In_This_Release-... (pg 10)
While trying to show you what I wanted to say that I found an example. PaneManagerDemo. Thanks for the help though, I really appreciate it. Nice day.
Tags: BlackBerry Developers
Similar Questions
-
problem with appearance of pane tab
The following code creates a tab simple part Manager with 2 tabs and simple LabelField for the tab labels. In the image as an attachment, you will see that there is a solid experience behind the LabelField. I tried to give transparent backgrounds of the LabelField, but who has not removed this experience. How can I get rid of this experience?
import net.rim.device.api.ui.*; import net.rim.device.api.ui.container.*; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.component.pane.*; import net.rim.device.api.ui.decor.*; public class BugRptTabs extends UiApplication { public static void main(String[] args) { UiApplication instance = new BugRptTabs(); instance.enterEventDispatcher(); } public BugRptTabs() { pushScreen( new BugScreen() ); } private class BugScreen extends MainScreen { public BugScreen() { super( Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR | Manager.NO_HORIZONTAL_SCROLL | Screen.DEFAULT_CLOSE | Screen.DEFAULT_MENU ); // setup the tab model with 2 tabs PaneManagerModel model = new PaneManagerModel(); model.enableLooping( true ); // create a transparent background Background bg = BackgroundFactory.createSolidTransparentBackground( Color.BLACK, 0 ); // setup the first tab VerticalFieldManager vfm = new VerticalFieldManager( Field.USE_ALL_HEIGHT | Field.USE_ALL_WIDTH | Manager.NO_VERTICAL_SCROLL | Manager.NO_HORIZONTAL_SCROLL ); LabelField lbl = new LabelField( "Content for tab 1", Field.FOCUSABLE ); vfm.add( lbl ); MyLabelField myLbl = new MyLabelField( "Tab 1", Field.FOCUSABLE ); myLbl.setBackground( bg ); Pane pane = new Pane( myLbl, vfm ); model.addPane( pane ); // setup the second tab vfm = new VerticalFieldManager( Field.USE_ALL_HEIGHT | Field.USE_ALL_WIDTH | Manager.NO_VERTICAL_SCROLL | Manager.NO_HORIZONTAL_SCROLL ); lbl = new LabelField( "Content for tab 2", Field.FOCUSABLE ); vfm.add( lbl ); myLbl = new MyLabelField( "Log", Field.FOCUSABLE ); myLbl.setBackground( bg ); pane = new Pane( myLbl, vfm ); model.addPane( pane ); // select the tab to be displayed model.setCurrentlySelectedIndex( 0 ); // setup the rest of the components HorizontalTabTitleView titleView = new HorizontalTabTitleView( Field.FOCUSABLE ); titleView.setNumberOfDisplayedTabs( 2 ); titleView.setModel( model ); PaneView paneView = new PaneView( Field.FOCUSABLE ); paneView.setModel( model ); PaneManagerView view = new PaneManagerView( Field.FOCUSABLE | Manager.NO_VERTICAL_SCROLL | Manager.NO_HORIZONTAL_SCROLL | Manager.USE_ALL_HEIGHT | Manager.USE_ALL_WIDTH, titleView, paneView ); view.setModel( model ); model.setView( view ); // set the background color of the tabs bg = BackgroundFactory.createSolidBackground( Color.BLACK ); titleView.setTabBackground( Field.VISUAL_STATE_ACTIVE, bg ); titleView.setTabBackground( Field.VISUAL_STATE_FOCUS, bg ); titleView.setTabBackground( Field.VISUAL_STATE_NORMAL, bg ); // set the background color of the remainder of the // title area (behind the tabs) titleView.setBackground( Field.VISUAL_STATE_ACTIVE, bg ); titleView.setBackground( Field.VISUAL_STATE_FOCUS, bg ); titleView.setBackground( Field.VISUAL_STATE_NORMAL, bg ); // configure the Controller HorizontalTabController controller = new HorizontalTabController(); controller.setModel( model ); controller.setView( view ); model.setController( controller ); view.setController( controller ); // add the tab manager to the MainScreen this.add( view ); } private class MyLabelField extends LabelField { public MyLabelField( String str ) { super( str ); } public MyLabelField( String str, long style ) { super( str, style ); } protected void paint(Graphics graphics) { graphics.setColor( Color.WHITE ); super.paint( graphics ); } } } }
A few other changes were necessary to 6.0. I removed titleView.setTabBackground (Field.VISUAL_STATE_FOCUS, bg); andtitleView.setBackground (Field.VISUAL_STATE_FOCUS, bg); and changed the way the labels have been added.
Rather than use a focusable LabelField, do the lbl1 and lbl2 LabelFields not focusable and create a NullField focusable. Add the two of them to a HorizontalFieldManager and also use the label to your component.
This allows the screenshot I attached (using the same Simulator with which you test).
Maybe you are looking for
-
FAFSA is the form to fill out for financial aid for College. I need to fill out the form later for the spring semester of next year. Until I'm able to fill it in online and save and send to school. When I'm on the site and click on fill out a form, a
-
Satellite A60-332: a wireless network or not?
I usually know if the model toshiba satellite sa60-332 the wireless network or not
-
L50-B-1NL satellite keyboard backlight
Hello I just got this laptop for Christmas, and I'm unable to turn on the backlight for the keyboard? I tried Google, which plans to use the FN key, but it does not work for me. This model offers backlit keyboards, and if so, how do I turn it on? Tha
-
HP software install Set Up for Photosmart series C4700
I just bought a new HP windows 8.1 (64-bit) pc. My old software for my Photosmart HP 4700 disk does not work on windows 8. Having serached the HP site, I downloaded "PS. AIO 06 C4700 140 408.exe. "that has been chosen as the 64-bit version It downloa
-
I was uninstalling programs unwanted of my HP Pavillion laptop and accidentally uninstalled my two-finger scrolling feature I went on the program of Recovery Manager, but I could not understand that one to reinstall.