android - Safe Background size -


so want use png background android application.

sample background

the condition biggest snowflake:

big snowflake

is @ top right corner. can scale image proportionately only, because otherwise, snowflake end looking bunch of don't know whats:

thorns

given plethora of device resolution , dpi's available, reasonable way achieve want?

update: aware of 9-patch. background cannot expressed in terms of 9-patch. @ best, can include source in largest dimensions (proportionately) possible. in case, source 1920x2400 in size. rephrase question, safest size (with uniform scaling) include in app?

here's example:

non-9patch drawable

image copyright of original authors. used here, illustration.

i this: use relativelayout set image @ top right corner of parent container, , resize image proportionally according screen size

example:

<relativelayout xmlns:android="schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" >      <imageview android:id="@+id/imageview1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:src="@drawable/expander_close_holo_dark" />  </relativelayout> 

as long provide image via android:src android automatically resizes preserving ratio.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -