java - Android ImageView getting over linearlayout -



java - Android ImageView getting over linearlayout -

i'm developing android application, layout shown in image below :

the layout contains 2 main linearlayouts : horizontal layout takes 90% of height of device , vertical layout takes 10% of it. within horizontal linearlayout there 3 linearlayout ( 2 reddish , 1 containing imageview). each reddish layout 10% of width of screen , 1 containing imageview 80%. here xml code :

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:weightsum="1" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_weight="0.9" android:weightsum="1" > <linearlayout android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="vertical" android:layout_weight="0.1" android:background="#ff0000" > </linearlayout> <linearlayout android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="horizontal" android:gravity="center_horizontal" android:layout_weight="0.8" > <imageview android:id="@+id/imageview1" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustviewbounds="true" android:src="@drawable/ic_launcher" /> </linearlayout> <linearlayout android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="vertical" android:layout_weight="0.1" android:background="#ff0000" > </linearlayout> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_weight="0.1" android:background="#000000" > </linearlayout> </linearlayout>

the problem is, when set png image (1036px x 730px ) source imageview, imageview on bottom linearlayout ( black 1 ) , 2 reddish layouts squeezed.

my question how can solve problem , have same layouts functional on kind of tablets ?

try way,hope help solve problem. <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <linearlayout android:layout_width="match_parent" android:layout_height="0dp" android:orientation="horizontal" android:layout_weight="0.90"> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:orientation="vertical" android:layout_weight="0.10" android:background="#ff0000" > </linearlayout> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:gravity="center_horizontal" android:layout_weight="0.80" > <imageview android:id="@+id/imageview1" android:layout_width="match_parent" android:layout_height="match_parent" android:scaletype="fitxy" android:src="@drawable/ic_launcher" /> </linearlayout> <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:orientation="vertical" android:layout_weight="0.10" android:background="#ff0000" > </linearlayout> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="0dp" android:orientation="vertical" android:layout_weight="0.10" android:background="#000000" > </linearlayout> </linearlayout>

java android android-layout

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -