Design question

hackhack

Active Member
Licensed User
Longtime User
I want to generate a layout in a scrollview from code.

But first, to make it easier on me (or so i thought) did a static layout in the designer, and then thought i could just copy the coordinates into my code - but when i do that the generated views look a lot larger than what i expected.

Any idea what I did wrong?
 

Cableguy

Expert
Licensed User
Longtime User
The designer uses dip values implicity, so in runtime you have to add the dip word to each value to be the same as in the designer...also the coordinates shoul be relative to the parent.
 
Upvote 0

hackhack

Active Member
Licensed User
Longtime User
Yeah, I read that, just can't get it to work.

*sigh* I'm beginning to understand why apple developers always says its hard to design an interface for androids.
 
Upvote 0

hackhack

Active Member
Licensed User
Longtime User
For instance,

In the designer I have an imageview, the designer says its Width is 138.

When I add the view I use "138dip" and the resulting imageview is TWICE as wide as the imageview I added in the designer.
 
Upvote 0

hackhack

Active Member
Licensed User
Longtime User
Hm, don't know if there was a bug here it was me, but I had deleted a larger variant in favor of the emulator default size but apparently it was still using another resolution in the variant, hence the weirdness.

Once I closed it all and started over the values were correct.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…