07.09.2010 19:26, Sara Khalatbari пишет:
Does anyone also happen to know how can we make a button that has been
created dynamically
set to "wrap_content" (as we do in the static mode) to make the
/button fit/ neatly around the text?
Use button.setLayoutParams
http://developer.android.com/reference/android/view/View.html#setLayoutParams(android.view.ViewGroup.LayoutParams)
with a subclass of LayoutParams appropriate for the button's parent
layout (i.e. LinearLayout.LayoutParams or RelativeLayout.LayoutParams).
Specify width and height as ViewGroup.LayoutParams.WRAP_CONTENT
--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en