I am a newbie in Android-programing and currently I'm building my first application. I have a LinearLayout (with several imageviews), which is situated inside of basic RelativeLayout. The xml width and heigth settings of LinearLayout are as follows:
android:layout_width="135dp"
android:layout_height="match_parent"
The settings of imageviews inside LinearLayout look like this:
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="125dp"
android:layout_weight="3"
.....
When I start my application on small screens, it looks normal, but when the screen is big, all the pictures become very narrow (the width of LinearLayout inside RelativeLayout stays the same on small and big screen). I tried to set it in percentage, but that is not allowed. So I ask you: how can I set the width of LinearLayout to be like 25-30% of the width of parent RelativeLayout(to make my images look pretty on any device).
I know that there is a layout_weight attribute, but it doesn't seem to work with layouts inside another layouts (or maybe I have no idea what is correct or what is not).
Aucun commentaire:
Enregistrer un commentaire