Well i have activity.xml i which i have a background image and a button which also has a background image in it run well on normal screen but when i run it on xlarge or large screen the position of button changes
<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"
android:background="@drawable/menu"
android:layout_margin="@dimen/my_view_margin"
>
<LinearLayout
android:layout_width="300px"
android:layout_height="200px"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="172dp"
android:orientation="vertical" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="60px"
android:background="@drawable/bt"
android:text="Button" />
</LinearLayout>
</RelativeLayout>
this is the code above and below are the images of different screen
cant add images cause doesnt have enough reputation
Use weight for all layouts instead of giving constant values, Because weight is a type of % for screen.In manifest by default support screen view is true.
and if any times you think, It's not possible than add dimens values {folder contains dimens.xml}
These links will help you to create application for multiple screens :
http://developer.android.com/training/multiscreen/screensizes.html
http://developer.android.com/guide/practices/screens_support.html
These are android's official documents on implementing support for multiple screen sizes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With