android - Why do these ImageButtons changing position using relative layout? -
learning android development through trial , error, i'm having slight issue rendering of buttons on top of image view depending on resolution of phone.
i have imageview 2 imagebuttons (at moment) on top. relative imageview. post xml markup below. issue when run on "nexus 4" in android studio, looks correct. when debug through samsung galaxy s4, imagebuttons off slightly, , i'm not sure why problem if relative imageview. understand resolutions different, how 1 go making sure renders same on smallest of screens, newer 1080p screens becoming more popular?
i can post pictures if need be, feel xml provide adequate information on issue.
any appreciated. in advance!
<imageview android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/srmap" android:layout_alignparenttop="false" android:layout_alignparentleft="false" android:background="@drawable/sr_map" android:layout_columnspan="2" android:layout_rowspan="1" android:layout_column="0" android:layout_row="0" android:contentdescription="map of summoners rift" android:croptopadding="false" android:layout_marginbottom="177dp"/> <imagebutton android:layout_width="15dp" android:layout_height="15dp" android:id="@+id/bluesidealert_bluebuff" android:background="@drawable/blue_alert_circle" android:layout_aligntop="@+id/srmap" android:layout_alignleft="@+id/srmap" android:layout_marginleft="90dp" android:layout_margintop="128dp"/> <imagebutton android:layout_width="15dp" android:layout_height="15dp" android:id="@+id/bluesidealert_redbuff" android:background="@drawable/blue_alert_circle" android:layout_aligntop="@+id/srmap" android:layout_alignleft="@+id/srmap" android:layout_marginleft="180dp" android:layout_margintop="215dp"/>
but how 1 go making sure renders same on smallest of screens, newer 1080p screens becoming more popular?
see docs here supporting different screen sizes/resolutions. create separate layout
files adjusted need. use different qualifiers layout folder name according docs , correct 1 used according device loads it.
you can try , adjust 1 file work on different screens lot better off using different layouts if ran on different screen sizes , resolutions.
for example: can have default res/layout
folder , res/layout-large
used on larger screens
Comments
Post a Comment