I have two cases with linear (also verified relative) layout in android. One occurs for horizontal, and the other for vertical. Let's start horizontally:
this is something like:
<LinearLayout ... > <Button ... layout:gravity = "left" layout:width = "wrap_content"/> <TextView ... layout:width = ??????? /> <Image .... layout:gravity = "right" layout:width = "wrap_content"/> </LinearLayout>
Well, I want the button to stay on the left, the image to the right (stick to the end, and not just to the right of the text view), and the text image (possibly with a tire or whatever) in the middle. If I put textview width = "fill / match_parent", it will send a screen image. If I put wrap_content, the image will not remain to the right of the screen. I also tried relative layout without success.
The same case in an upright position where I have something like:
<LinearLayout ...> <LinearLayout .... layout:height = "wrap_content" layout:gravity= "top" /> <ListView layout:height = ???????> <LinearLayout ... layout:height = "wrap_content" layout:gravity = "bottom" /> </LinearLayout>
The same requirements are here. I want the first L.layout to stay on top, automatically browse the list between them and the second line layout to stay at the bottom. (Imagine trying to create a UITableView-like view on an iPhone that has a NavigationBar, a list of items and a ToolBar at the bottom. Fist LinearLayout are the NavigationBar, LIst are the cells, and the second LinearLayout is the ToolBar).
Any suggestions? Prefer xml solutions.
Panos
source share