Friday, March 7, 2014

Seeking a simple layout: three buttons on the right side to the right, the left one input box to fill other spaces, thanks


If I want to display a row of four controls
TextView1, Button1, Button2, Button3
Requirements
Button1, Button2, Button3 on the right side of the screen shows
All space
TextView1 on the left display, and fill the rest of the

Thank you<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
The three button wrapped in a LinearLayout or RelativeLayout inside the Layout and TextView horizontal layout, they both parent component layout can be selected relatively RelativeLayout
Reply:
 

android: layout_width = "match_parent"
android: layout_height = "wrap_content">

android: id = "@ + id/textView1"
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: layout_toLeftOf = "@ + id/button1"
android: text = "TextView" />


Reply:
< br />Upstairs, I this is to fill the remaining space
Reply:
reference to the third floor javamy020 reply:

I this is to fill the remaining space upstairs

Already filled, you add a background color look
Reply:
  
android: layout_width = "match_parent"
android: layout_height = "wrap_content">

android: id = "@ + id/textView1"
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: layout_toLeftOf = "@ + id/button1"
android: text = "1231232131231231231232132131232132313213123123213" />



Reply:
 

android: layout_width = "match_parent"
android: layout_height = "match_parent">

android: id = "@ + id / right"
android: layout_width = "wrap_content"
android: layout_height = "fill_parent"
android: layout_alignParentRight = "true"
android: layout_marginLeft = "3dp"
android: orientation = "vertical">

Reply:
Is not it so?
Reply:
With LinearLayout, the TextView1 the layout_width = 0dp, layout_weight = 1, other buttons layout_width = wrap_content
Reply:

android: layout_width = "match_parent"
android: layout_height = "match_parent">

android: id = "@ + id / right"
android: layout_width = "wrap_content"
android: layout_height = "fill_parent"
android: layout_alignParentRight = "true"
android: layout_marginLeft = "3dp"
android: orientation = "vertical">

No comments:

Post a Comment