android - Tool/way to preserve handset layout proportions on tablet devices -
here's illustration layout:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity" > <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:layout_margintop="50dp" android:text="@string/hello_world" /> <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textview1" android:layout_centerhorizontal="true" android:layout_margintop="50dp" android:src="@drawable/ic_launcher" /> </relativelayout>
on handset(480x800) , tablet(1280x800) layout has different amount of space left imageview bottom. image isn't scaled on tablet , dp values result in relatively same physical values.
is there way/tool save handset proportions tablets images, spaces(dp) scaled? guess, utilize values-xlarge/dimen.xml, values-720dp/dimen.xml, it's lot of mechanical job to. improve solution ?
if want adjust scaling of imageview add together
android:scaletype="fitxy"
here imageview scale types http://developer.android.com/reference/android/widget/imageview.scaletype.html
android android-layout
No comments:
Post a Comment