Expanding on fedj’s answer, if you set layout_width
to 0dp
and set the layout_weight
for each of the buttons to 1, the available width will be shared equally between the buttons.
More Related Contents:
- Linear Layout and weight in Android
- Android LinearLayout : Add border with shadow around a LinearLayout
- How to add a TextView to a LinearLayout dynamically in Android?
- Is a RelativeLayout more expensive than a LinearLayout?
- Software keyboard resizes background image on Android
- How to group RadioButton from different LinearLayouts?
- How do I use a compound drawable instead of a LinearLayout that contains an ImageView and a TextView
- java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.Gallery$LayoutParams
- What are the differences between LinearLayout, RelativeLayout, and AbsoluteLayout?
- Fit Image in ImageButton in Android
- Android: How to Programmatically set the size of a Layout
- How to show shadow around the linearlayout in Android?
- How to add (vertical) divider to a horizontal LinearLayout?
- Get all child views inside LinearLayout at once
- onClick not triggered on LinearLayout with child
- Scrolling with Multiple ListViews for Android
- How to add border around linear layout except at the bottom?
- Setting a maximum width on a ViewGroup
- Android: How to measure total height of ListView [duplicate]
- How do you make a LinearLayout scrollable?
- Put buttons at bottom of screen with LinearLayout?
- Android LinearLayout Gradient Background
- ScrollView not scrolling at all
- Adding LinearLayout programmatically in Android doesn’t work
- How to use getResource.getIdentifier() to get Layout?
- How to set Ripple effect on a LinearLayout programmatically?
- Refreshing a LinearLayout after adding a view
- TextView restarts Marquee when changing another TextView in same LinearLayout
- How to set both gravity and layout gravity of a LinearLayout programatically
- combining wrap_content on parent and fill_parent on child