I am setting the width of EditText element to fill_parent in XML file, but when accessing it from code, it returns 0.
What I want, is the actual width of that element at run time. How could I do it.
I am setting the width of EditText element to fill_parent in XML file, but
Share
Use getMeasuredWidth(): http://developer.android.com/reference/android/view/View.html#getMeasuredWidth%28%29
Read also here:
http://developer.android.com/guide/topics/ui/how-android-draws.html