I have a ListView where each objects in the list has the parameter:
android:layout_height="wrap_content"
However, this makes the objects hard to press. I don't want to increase the font size to achieve this. Instead, can I add a buffer to wrap_content?
I'd like to implement something like:
android:layout_height="wrap_content" + 10dp
How do I do this?
Thanks
Add some margin or padding to your views. Alternatively, embed a <View>
element with fixed 10dip height.
you can use padding property so its automatically set height & width what you want...
android:padding="10dip"
you would have to do that programmatically most likely. Because that method wont work.
Not exact coding but along the lines:
View what_i_want_to_resize = (View)findViewById(R.id.myview);
View view_with_the_size = (View)findViewById(R.id.sizeview);
what_i_want_to_resize.setMinimumHeight(view_with_the_size.getMeasuredHeight() + 10);
Something along those lines. It is impossible to do it with XML.
You can also add padding to it.
android:padding="10dp"
That will make a padding or cushion between the views.
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