Ilutration:
"----" indicates a Layout area
"...." indicates another Layout area
<-------------------->
<----<TextView_1>---->
<-------------------->
<-<..<TextView_a...>->
<-<... ...>->
<-<... ...>->
<-<... >...>->
<-<................>->
<-<................>->
<-<................>->
<-<..*layout_end*..>->
<-------------------->
<----<TextView_2----->
<----- >----->
<-------------------->
The content of the "...." layout is just TextView_a, that isn't big enough to fill until the *layout_end*.
If I put match_parent in the "...." layout, the TextView_2 doesn't appear. Like this:
<-------------------->
<----<TextView_1>---->
<-------------------->
<-<..<TextView_a...>->
<-<... ...>->
<-<... ...>->
<-<... />...>->
<-<................>->
<-<................>->
<-<................>->
<-<................>->
<-<................>->
<-<................>->
<-<................>->
<-<..*layout_end*..>->
I need to "...." layout fills the space, but leave a space just for the TextView_2. What can I do to have the hight result? That result:
<-------------------->
<----<TextView_1>---->
<-------------------->
<-<..<TextView_a...>->
<-<... ...>->
<-<... ...>->
<-<... >...>->
<-<................>->
<-<................>->
<-<................>->
<-<..*layout_end*..>->
<-------------------->
<----<TextView_2----->
<----- >----->
<-------------------->
Right: http://s30.postimg.org/f63iski0h/correto.png Wrong: http://s11.postimg.org/jdq8al71f/incorreto.png
create a vertical linear layoutlike this:
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="mtch_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dip"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dip" android:layout_weight="1">
<!-- put your TextView here -->
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dip"/>
</LinearLayout>
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