I'm having a hard time working with the BlackBerry UI API.
What I want to do is creating a "list item" based on a HorizontalFieldManager that consists of the following childFields:
An optional BitmapField (Horizontal-Left, Vertical-Center)
A LabelField (Horizontal-left, Vertical-Center)
A rounded rectangle that contains an single line EditField. The rounded rectangle has a fixed width and height, so the EditField should scroll horizontally inside the rounded rectangle when the text becomes wider than the rounded-rectangle's width.
I've added a image illustrating the desired situation below:
Can someone help me with this?
Thanks in advance!
Related
I'm trying to wrap content to display in an HTML email in a container that will display with rounded corners.
I wanted to even show the rounded corners when the recipient views it from Outlook so I was hoping to use VML's "roundrect" as described in:
https://gist.github.com/elidickinson/9424116#file-html_email_buttons_1-html
It looks like this only works for fixed sized content though. My container would need to grow to fit the size of the content. Is there anyway to make roundrect do that?
Is there any better option for displaying rounded corners in Outlook? I'd like to stay away from using images for the rounded corners.
Thank you!
As far as I can recall if you are creating a button using VML then it needs to have a fixed width and height.
If you are creating a background image then dont need the width and height. Background.cm is a really good resource for you to create VML based buttons or backgrounds. Hope that helps.
Cheers
I have a button inside a horizontal stack view and am trying to give it a border using the Runtime Attributes in Xcode. Here is what my storyboard looks like:
When I run my app the text has no padding so the border fits very tight:
Is there any way to make the border of the button fit a bit looser? I can't seem to make the UIButton bigger since it's in a stack view...
you can look at lowering the content hugging priority of the add button as both are UIButtons and have same compression resistance and content hugging priority and stack view algorithm in such cases stretches the leftmost view.
You have to set a width constraint on the button.
I have one view filling the screen with a background image. Other views (text fields) are in exact positions (the background image includes the text field background images). When I change from 3.5" screen to 4", the text fields don't change in the same way that the background resizes. The bg image simply resizes to fill the screen, but the text fields jump out of alignment.
Is there a way to have two sets of constraints, one for each screen size? or is there a way to have views resize proportionally to another view?
EDIT:
Is there a way to have two sets of constraints, one for each screen
size?
Yes, by adding constraints programatically and checking [[UIScreen mainScreen] bounds] to get the screen size.
or is there a way to have views resize proportionally to another view?
Yes, you could set this up in interface builder. But it will be hard to manage, I would manage the constraints manually in code since you are using a custom background image the textviews need to position exactly
You're going to struggle to get these things to line up properly with the text view backgrounds being part of the background image.
You should amend your image assets and use the background property of UITextField to have an actual background image, and remove the boxes from your main background image. The icons could be separate images as well.
Failing that, it would make more sense to have the image stretch underneath the text boxes rather than on top.
Your layout is doing what it should do based on your description, but the image isn't stretching in the right way. In your screenshots, username is always the same distance from the top, and the others are the same distance from the bottom, but that isn't how image stretching works. I don't know how you've set it up but it would make sense to have a single image the size of the 4 inch screen, which has the bottom cut off for 3.5 inch devices, and constrain everything from the top.
I have a borderPane with a menu top,a grid left and an image in the center.I want the image to have the same size as the center of the border because now the image goes over my grid.
I tried this:
imageView.fitWidthProperty().bind(box.widthProperty());
where imageView is the name for my image and box is the BorderPane object.Thank you.
See JavaFX Feature Request RT-21337 Add ImageViewPane and MediaViewPane controls which contains a code attachment for a sample ImageViewPane implementation which which will resize the ImageView it contains to the area available to the region. To get the behaviour required you might also need to implement computeMinWidth and computeMinHeight on the ImageViewPane so that they return zero rather than the minimum size of the Image.
now the image goes over my grid
This is because the minimum size of your image is currently larger than the available space of the center of your BorderPane:
BorderPane does not clip its content by default, so it is possible that childrens' bounds may extend outside its own bounds if a child's min size prevents it from being fit within it space.
Some potential alternatives to prevent the center content overflowing the border:
Manually set a clip on the center node to prevent it overflowing the borders.
Dynamically resize the ImageView as in the ImageViewPane sample linked above.
Place the ImageView in a ScrollPane.
Use the css -fx-background-image attributes to display and dynamcially resize your image rather than using an ImageView.
Set the center of the borderpane first before setting the border content, that way it will be rendered underneath the border content.
Use a different construct from a borderpane (e.g. a HBoxes, VBoxes, etc.) which don't overlap their nodes when the nodes are larger than the available display area.
I tried this: imageView.fitWidthProperty().bind(box.widthProperty());
My guess from the code provided is that this didn't work because the enclosing box of the image is a dynamically resizable pane of some sort, so the minimum width of the box is being determined by the width of the image and not vice versa.
I have a listview that I want to implement the effect seen in this image:
The listview hides some items like in the image below except a
password is entered. I know that item and subitem image are usually
left aligned.
How do I set the item and subitem image to cover the whole text are of the list view as shown?
EDIT
I got a tip of how to draw the pattern in this pics from here, but how do I draw this on a listitem?
You'll be better off using subclassing and owner/custom drawing. That will allow you to draw that entire row and let the listview deal with the rest.