Android image scale -


i have problem background, have background color, , 1 image on right bottom of screen. have layout file. relative layout. in relative layout place android:background="@drawable/background".

the following code code have placed in background.xml. file stays in drawable folder.

this code doen't work right me, image fullscreen. can me? not this.

the code:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">   <item android:id="@+id/background" >     <shape android:shape="rectangle">         <solid android:color="@drawable/lightgray"/>     </shape> </item>  <item      android:id="@+id/item_img"     android:layout_width="10dp"     android:layout_height="10dp"     android:scaletype="fitxy">      <bitmap           android:src="@drawable/bg"         android:layout_width="match_parent"         android:layout_height="match_parent"         /> </item>  </layer-list> 

the relative layout startpage here.

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/container"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:background="@drawable/background"     android:paddingbottom="@dimen/activity_vertical_margin"     android:paddingleft="@dimen/activity_horizontal_margin"     android:paddingright="@dimen/activity_horizontal_margin"     android:paddingtop="@dimen/activity_vertical_margin"     tools:context=".startpage" > 

this im guessing, create linear layout in relative layout.. , can control scalling.. , can please post actual layout(xml) have posted comment dont have enough reputation..

try dis

<item    android:id="@+id/item_img"   android:layout_width="wrap_parent"   android:layout_height="wrap_parent" >      <bitmap         android:src="@drawable/bg"       android:layout_width="10dp"       android:layout_height="10dp"       android:scaletype="fitxy" /> </item> 

try approach..ive not tested yet...


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -