android: layout_width = "match_parent"
android: layout_height = "wrap_content">
android: id = "@ + id / buttonLeft"
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: text = "buttonLeft" />
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" />
I want a button on the left just occupy the remaining space
current rowHow to write?
Cluster<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: orientation = "horizontal">
android: id = "@ + id / buttonLeft"
android: layout_width = "0dp"
android: layout_weight = "1"
android: layout_height = "wrap_content"
android: text = "buttonLeft" />
android: id = "@ + id/button2"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "Button2" />
android: id = "@ + id/button3"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "Button3" />

Reply:
android: layout_height = "match_parent">
android: layout_width = "wrap_content"
android: layout_height = "fill_parent"
android: layout_alignParentRight = "true"
android: layout_marginLeft = "1dp"
android: orientation = "horizontal">
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: id = "@ + id / text"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_alignParentLeft = "true"
android: layout_toLeftOf = "@ + id / right"
android: text = "godbtn"
/>

Reply:
android: layout_width = "match_parent"
android: layout_height = "wrap_content">
android: id = "@ + id / buttonLeft"
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
<-! Only need to add this line can be achieved ->
android: layout_toLeftOf = "@ + id/button2"
android: text = "buttonLeft" />
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" />
No comments:
Post a Comment