i would like to know how can i create a custom popup in blakcberry in order to set the Fields in this way:
------Text---------
Button1 Button2
Create a class that extends Popup .
In this class use your own manager
in your case you need
one vertical field manager
add a text into it
prepare a horizontal field manager
add both buttons into it
add that horizontal field manager into vertical field manager
And add vertical field manager in your screen
Related
Heloo all,
I am new to ios swift. I have one problem in my screen.
I have one screen with drop down list of option like : current bill,water bill., bike bill, loan bill, phone bill....so on
I have sone this. But what i need is, whenever i select any option from drop down list. I need to show some ui elements like label, text filed, text box, lie that dynamically for each each selction in drop list.
For example :
if i select water bill, then below my drop down, i need to show the two label ui with name , id.
if i select current bill , then below my drop down , i need to show one text filed with place holder ' enter current bill number'
So like wise when ever i select any option from drop down..i need to show some dynamic ui.
How can i achive that ??
ANY HELP WILL BE USE FULL
You can make use of container views to achieve that:
1- Add your drop down menu to any view controller you want.
2- Add a container view under that drop down menu and using auto layout make that container view fill the place that you want it to be switchable/dynamic.
3- Redo step 2 as many times as the items of the drop menu.
4- Create IBOutlets for each of your container views and and an IBAction for your drop down menu.
5- In the IBAction of your drop down menu, set isHidden property of one container view to false and set it to true for the others based on the user's selection from the drop down menu.
Here is a tutorial that explains that with a simple example.
Just drag and drop viewcontrollers in your storyboard for your current bill,water bill., bike bill, loan bill, phone billetc.
And when ever you change the option from your drop down list use below code to add your required controller as child controller.
let currentBill = self.storyboard?.instantiateViewController(withIdentifier: "currentBill") as! CurrentBillVC
// remove other views
for k in 0..<self.parentView.subviews.count {
self.parentView.subviews[k].removeFromSuperview()
}
self .addChildViewController(currentBill)
// Add view to your maincontroller i named it parent view in which you want to display other controller w.r.t your drop down list.
self.parentView .addSubview(currentBill.view)
currentBill.didMove(toParentViewController: self)
I have customized a field which contains an ObjectChoiceField. After clicking a choice,the screen just scrolls to the top and the choice field drops down from the visibile screen。Pls tell me how to prevent this。Thank you。
You can find out custom drop down list implementation in this thread: Issue in PopUpScreen
This custom drop down does what you want.
in my screen , i want to create/add button with an icon and under this icon i want to write the title of this button
like this picture
Create a custom Field.
For instance, here is an idea of what to do. Your bitmap could alreay contain a label, or to have a String label freely "assignable" to this button you can extend that example (by adding the code to draw the label in paint(Graphics graphics), check the API of Graphics - it is possible to write a text on it).
Hello everybody I am trying to create a screen (to see the image click here)
I have set it's backround image also created required list components which are click able by extending Field class. Now my problem is I am not able to set that rounded white color as backround of the list. Please help me. And also because I am new to the blackberry please also tell me the optimized way to create this screen.
i think like this
1) header bar - create manager and embed 2 buttons and 1 label in it
2) bottom bar - create a global class that contains the buttons and define a method that responds to the click event of these buttons
call that class in this main screen
3) for middle part use a list field which is scrollable
I have created a class that extends HorizontalFieldManager so that I can display a label and an image on the same line with the label to the left and the image to the right. I want the user to be able to interact with the hfm as if it were a single field. I have everything working (focus, click action, etc) except the menu. When I press the menu button makeMenu and makeContextMenu are not called. How do I make it so that the correct menu shows when the menu button is clicked and focus is on the hfm? Am I going about this the wrong way?
Where do you override makeContextMenu, in the Hfm? You might have to override them in the label and image.
Or, less elegantly, you could just check in the makeMenu() function of your screen if the hfm has focus (or its children) and then add your menu item there.