Is there a direct programmatic way to get a fill_parent View's pixel height and width? For instance a view in a grid layout in a tab. Or do I have to get the window size and subtract the static sizes of the views around it?
You can get the views parent by calling myView.getParent()
and with getWidth()
and getHeight()
you get the pixel you need.
the documentation is providing more information to this topic
http://developer.android.com/reference/android/view/View.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With