It doesn’t work because you are using fill_parent as the width. The weight is used to distribute the remaining empty space or take away space when the total sum is larger than the LinearLayout. Set your widths to 0dip instead and it will work.
More Related Contents:
- Android: How do I prevent the soft keyboard from pushing my view up?
- Android: alternate layout xml for landscape mode
- How to get screen dimensions as pixels in Android
- Lock screen orientation (Android) [duplicate]
- how to read value from string.xml in android?
- How to size an Android view based on its parent’s dimensions
- What’s the difference between fill_parent and wrap_content?
- How to make an Android SlidingDrawer slide out from the left?
- How do you setLayoutParams() for an ImageView?
- Android: Custom Title Bar
- How to change line color in EditText
- “You need to use a Theme.AppCompat theme (or descendant) with the design library” error
- Change the Right Margin of a View Programmatically?
- Change the text color of a single ClickableSpan when pressed without affecting other ClickableSpans in the same TextView
- Change shape solid color at runtime inside Drawable xml used as background
- “Canvas: trying to draw too large bitmap” when Android N Display Size set larger than Small
- Android: How to make all elements inside LinearLayout same size?
- Android — How to position View off-screen?
- If I call getMeasuredWidth() or getWidth() for layout in onResume they return 0
- What is the correct way to specify dimensions in DIP from Java code?
- Modifying the Android seekbar widget to operate vertically
- How to resize a android webview after adding data in it
- How to make my layout able to scroll down?
- Creating multi-screen support app android
- Android layouts for different screen sizes
- Text/Layout Alignment in Android (textAlignment, gravity)
- Android ImageView size not scaling with source image
- How to support all the different resolutions of android products
- GridLayoutManager – how to auto fit columns?
- How to refresh a GridView?