layout - Android: How to make all elements inside LinearLayout same size? -
I want to create a dialog for displaying a video title and tag. Below the text I want to add buttons, view, edit and delete and make these elements the same size. Does anyone know how to modify the .xml layout file to create elements inside the same size as LinearView?
The current layout file looks like this:
& lt; LinearLayout xmlns: Android = "http://schemas.android.com/apk/res/android" android: layout_width = "fill_parent" Android: layout_height = "wrap_content" Android: orientation = "vertical" & gt; & Lt; LinearLayout Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" android: orientation = "vertical" & gt; & Lt; TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: id = "@ + id / txtTitle" Android: text = "[title]" & gt; & Lt; / TextView & gt; & Lt; TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: id = "@ + id / txtTags" Android: text = "[tag]" & gt; & Lt; / TextView & gt; & Lt; / LinearLayout & gt; & Lt; LinearLayout Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" android: orientation = "horizontal" & gt; & Lt; Button Android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: id = "@ + id / btn play" Android: text = "see" & gt; & Lt; / Button & gt; & Lt; Button Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: id = "@ + id / btn edit" Android: text = "edit" & gt; & Lt; / Button & gt; & Lt; Android on the button: layout_width = "wrap_content" Android: layout_height = "wrap_content" android: id = "delete @ + ID / BTN" Android: text = "delete" & gt; & Lt; / Button & gt; & Lt; / LinearLayout & gt; & Lt; / LinearLayout & gt;
I would appreciate that anyone can show the solution by modifying the pasted file content.
Thank you!
Android: and Android: layout_weight = "1"
Three: Android: Code: Use
button
. It says that the button should not take more than 0 pixels, but three of them should split any extra space between them. This should give you the visual effect you want.
Comments
Post a Comment