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" />
android: id = "@ + id/button1"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_toLeftOf = "@ + id/button2"
android: text = "Button1" />
android: id = "@ + id/button2"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_toLeftOf = "@ + id/button3"
android: text = "Button2" />
android: id = "@ + id/button3"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_alignParentRight = "true"
android: text = "Button3" />
Reply:
Reply:
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" />
android: id = "@ + id/button1"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_alignParentRight = "true"
android: text = "Button1" />
android: id = "@ + id/button2"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_alignParentRight = "true"
android: layout_below = "@ + id/button1"
android: text = "Button2" />
android: id = "@ + id/button3"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_alignParentRight = "true"
android: layout_below = "@ + id/button2"
android: text = "Button3" />

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">
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "btn1" />
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "btn2" />
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "btn3" />
android: id = "@ + id / text"
android: background = "# 336699"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_alignParentLeft = "true"
android: layout_toLeftOf = "@ + id / right"
android: text = ""
/>
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_height = "match_parent">
android: layout_width = "wrap_content"
android: layout_height = "fill_parent"
android: layout_alignParentRight = "true"
android: layout_marginLeft = "3dp"
android: orientation = "vertical">
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "btn1" />
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "btn2" />
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "btn3" />
android: background = "# 336699"
android: layout_width = "wrap_content"
android: layout_height = "fill_parent"
android: layout_alignParentLeft = "true"
android: layout_toLeftOf = "@ + id / right"
android: text = ""
/>
No comments:
Post a Comment