I'm new to Blend 4 and I'm wondering why the Grid layout seems to have it's (0, 0) position in the lower-right corner instead of the upper-left corner ? Can I change it ? Because I want to set Rows/Cols height/width relative to the upper-left corner
The Grid Panel's row/columns do pertain to the upper-left corner. Here's a short tutorial on layout controls in Silverlight by Scott Gu:
http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-2-using-layout-management.aspx
Sometimes when working with Blend it will set crazy margins on controls which make them appear to be in different columns. I would look at the xaml and ensure there's no other properties (margin, padding, transforms) that are making the control appear to be somewhere else in the layout.
Related
I wanted to change some small controls by selecting and arranging them. they are at the bottom right corner, so when I use the usual zoom in, they go out of sight and became inaccessible from my screen. is there any way I can just zoom into my desired controls or set of controls? Also, I can't resize the designer itself, as I already using its maximum width.
Thanks for any help.
In the properties, , select ScrollBars #3, the Set ScrollHeight and Width to 150% of your form hight and width.
I'm using the Java Scene Builder 2.0 to create a GUI that uses the tab pane. I've added an Imageview to each tab so I can give them icons instead of text. I set the tabs minimum width and height to 100x100 and they adjust to that size. When I add an imageview to the tab I'm making it's minimum width and height 100x100 but it shrinks the tab size and only shows a part of the icon. This happens when the imageview has a picture and when it doesn't so I don't think it's a problem with the size of the picture.
You can see from this picture the first tab from the left doesn't have an imageview and is the size I want the tabs to be. The second tab has an empty image view and the rest of the tabs have images. I would like the images to be 100x100 and fit in the tabs.
A Java Scene Builder solution is prefered but I will also gladly accept a code solution.
I solved the problem it was something simple. In the tab pane Layout settings I only changed the min height/width to 100x100 but I left the max height/width to the default which was 1.7976931348623157E308. I didn't notice that number was so small at first and I changed it to 200. Now the images display better.
I have an iPhone app that will only ever be in Portrait view.
I have a number of buttons etc. on my layout. However, when I switch between iPhone 4 and iPhone 5 sizes, I need the bottom image to "stick" to the bottom. The rest of the images and buttons can stay where they are. I just need to bottom white image to look like a footer.
Can anyone please tell me how to do this?
I have tried using constraint (Pin) and set the bottom margin value to 0 but this simply stretched the bottom white image across the entire View.
Below are 2 screen grabs of how the layouts appear for both iPhone 4 and 5 (this is taken in Storyboard)
iPhone 4
And iPhone 5
You can just add a constraint to the bottom layout guide and set it to zero.
From your storyboard/xib, place the view at the bottom of the container, drag&drop from the view to the view itself but be sure to dragging downward. Then select "Bottom Space to Bottom Layout Guide". Now your view is fixed at this distance from the bottom of the main view.
You obviously have to set up the other constraints for the white view (width, height and horizontal position).
my problem is getting the Sprite in a Sprite "Sheet".
public class Blocks extends Sprite{
public Blocks() throws IOException
{
super(Image.createImage("/blockSprite.png"),20,30);
}
}
"the blockSprite.png contains images of Sprites, many sprites in 1 image"
The problem here is using this line of code, how I am supposed to get the Sprite size/dimension in the image?
Sprite Sheet:
Width - 162
Height - 280
I want to know the width/height of the sprites in the sheet? and how to determine the width/height of the sprites in a Sprite Sheet?
You do know how many sprites are there in each row and column right? then just divide the width with how many sprites are there in a column and divide the height with how many sprites are there in a row.
(I may get the column and row wrong, I'm not native English, but you should just switch the row/column if the first try didn't work out)
One way is to use an image editing software (say GIMP, its free).
What you have to do is,
Open the image in GIMP
Click on the Rectangle selection tool (or press r), your mouse will turn into a cross hair
Now when you click on the image, in the tool box, under tool options you will see the X-Y position of the point you clicked
Cool, now draw a rectangle around the sprite that you want. Zoom in before you do this, so that you are actually selecting the whole
sprite.
Now you will get both the X-Y coordinates of the top-left corner of the rectangle that you drew and the height and width of the image.
After that, just use https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Using_images#Slicing.
Have fun!!
I need to set allignment of the text in a TextField to right. There is no such under TextField.
Anybody knows how to set alignment in a textfield in javaFX 2.0 ?
Thanks
In JavaFX 2.0, it may not have been possible, but it is in JavaFX 2.1 and ownward using the alignment property.
Programmatically
textField.setAlignment(Pos.CENTER_RIGHT);
or
via FXML
<TextField ... alignment="CENTER_RIGHT"/>
or
via CSS
.text-field {
-fx-alignment: center-right;
}
Possible values
Programmatic/FXML
CSS
Description
BASELINE_CENTER
baseline-center
Represents positioning on the baseline vertically and on the center horizontally.
BASELINE_LEFT
baseline-left
Represents positioning on the baseline vertically and on the left horizontally.
BASELINE_RIGHT
baseline-right
Represents positioning on the baseline vertically and on the right horizontally.
BOTTOM_CENTER
bottom-center
Represents positioning on the bottom vertically and on the center horizontally.
BOTTOM_LEFT
bottom-left
Represents positioning on the bottom vertically and on the left horizontally.
BOTTOM_RIGHT
bottom-right
Represents positioning on the bottom vertically and on the right horizontally.
CENTER
center
Represents positioning on the center both vertically and horizontally.
CENTER_LEFT
center-left
Represents positioning on the center vertically and on the left horizontally.
CENTER_RIGHT
center-right
Represents positioning on the center vertically and on the right horizontally.
TOP_CENTER
top-center
Represents positioning on the top vertically and on the center horizontally.
TOP_LEFT
top-left
Represents positioning on the top vertically and on the left horizontally.
TOP_RIGHT
top-right
Represents positioning on the top vertically and on the right horizontally.
Currently It does not have a support on text field alignment.
I reported this issue to javafx jira team and this feature will be added in version 2.1.
Here is the link.
http://javafx-jira.kenai.com/browse/RT-18410?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel