How can i command my view layout?

laylo

New member
Hi,

I have been playing around with the tutorials but cannot seem to lay stuff out the way i would logically -think- to lay them out like i would in normal 2d graphics or even on a webpage. The only options i seems to get are layout_width = fill_parent or wrap_content. I found width and height, but when i enter a number value it crashes.

How can i get a set of buttons exactly say.. 20x20 across the top and down the side with a canvas in the rest of it? (Basically draw them where i want with X&Y)

The examples do not seem to cover more advanced gui layout other than just some basic controls on the page.

Any help would be appreciated.
 
Those are just small parts of laying stuff out, the real grunt is done by the xLayout containers such as LinearLayout, TableLayout, etc which can be combined to create complex layouts.

Have you read this?
http://developer.android.com/guide/topics/ui/declaring-layout.html
 
I did read through it, but i guess i did not absorb it so well

I am still a little confused how things can lay out exactly the way i want them though.

I will do some more experiments and see what i get.
 
That's the point though. Using fixed sizes in pixels is a bad idea when there are so many different resolutions on Android phones. With a fixed size interface, what happens if someone uses your app that has a lower resolution? Some of your interface will be off the edge of the screen and be inaccessible. If the user has a phone with a higher resolution, your interface will be sat in one corner looking very small.
 
Is this the kind of layout you're after? As extorian says, it's best not to use fixed sizes. Use sp for font sizes as it scales for the users font size preference and dip (or dp, same thing) for everything else.

Code:
?? ?
?? ????????
?? ????????
?? ????????
????
????
????????
????????????????
???????? ? ????????
???????? ? ????????
????????
????????
????
 
Thank you very much for that, i think i get it now.

In regards to "dp" i assume they are a sort of "virtual" pixel in regards to screen size, but what are they measured in? percent?
 
Related to the density of the pixels on a screen. A bigger screen with the same resolution as a smaller screen will have a lower density.
If the bigger screen was double the physical size in each direction and its density made it so that 1dp = 1pixel then on the smaller screen 1dp = 2pixels. So if you were looking at the same thing on each screen they would be the same physical size but take up different amounts of pixels. (Or something like that)
 
Or another way of looking at it... is that a line of 160dp = 1 inch of pixels on any screen no matter what device it is.

I think... been a long time since I did this lol.
 
Hi,

I would like to display the Layout Preview of a report from the On_Click
event on my form. I know acViewNormal, acViewPreview and acViewDesign but
Preview still runs the query in the report (some of which takes several
minutes).

Is there a code to take it from Design View to Layout Preview I could use?
Or a way to go straight to Layout Preview?

Thanks,
 
Back
Top