Resize views in a layout
I have a horizontal linear layo开发者_运维问答ut with multiple image views. Is there a way to resize these views automatically, so that all of them fit inside the screen? this is the code:
<LinearLayout
android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/cinnamon"/>
<ImageView
android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@+id/cinnamon"/>
<ImageView
android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ham"/>
Best Regards
With all the image views make sure that you set the layout to whatever best fits your needs. Try "fill_parent". For width and height. Provide us with some code and a better description of the layout you want to appear to the user and we can give you better example of what you need. If this helps, let us know.
Solution
Set layout_weight
to 1 for every image view.
精彩评论