[mono-android] How to use "dip" or "dp" layout dimension for LayoutParams width and height?
Sellec
echelonww at gmail.com
Wed Jun 27 19:18:14 UTC 2012
Sorry about my question, but i dont see any information in google.
How can i set width like "30dp" for dynamically created label in my custom
view?
For example:
var label1 = new TextView(this.Context);
label1.LayoutParameters = new
ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, 30);
label1.Gravity = GravityFlags.CenterVertical;
label1.SetText("test", TextView.BufferType.Normal);
this.AddView(label1);
But this height of 30 is set with normal pixels and looks different on
emulator and real device (screen dimensions is different). And i dont see
any way to set a type of pixels for layoutparams. How can i do this?
--
View this message in context: http://mono-for-android.1047100.n5.nabble.com/How-to-use-dip-or-dp-layout-dimension-for-LayoutParams-width-and-height-tp5710626.html
Sent from the Mono for Android mailing list archive at Nabble.com.
More information about the Monodroid
mailing list