android how change size image in background xml -


i'm making layer-list drawable... set stroke (2dp, color: #000000), corners (5dp), background (yellow) , add image on right side, can't change image size.

what want: what want

but have that:

wrong effect

this code: content_main.xml:

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:paddingbottom="@dimen/activity_vertical_margin"     android:paddingleft="@dimen/activity_horizontal_margin"     android:paddingright="@dimen/activity_horizontal_margin"     android:paddingtop="@dimen/activity_vertical_margin"     app:layout_behavior="@string/appbar_scrolling_view_behavior"     tools:context="info.e_konkursy.myapplication.mainactivity"     tools:showin="@layout/app_bar_main">       <tablelayout         android:layout_width="match_parent"         android:layout_height="match_parent">          <tablerow             android:layout_width="200dp"             android:layout_height="20dp"             android:background="@drawable/bg_tablerow11"             android:padding="10dp">              <textview                 android:id="@+id/textview2"                 android:layout_width="100dp"                 android:text="@string/country"                 android:textappearance="?android:attr/textappearancemedium" />              <textview                 android:id="@+id/textview3"                 android:layout_width="150dp"                 android:layout_height="20dp"                 android:text="poland"                 android:textappearance="?android:attr/textappearancemedium" />         </tablerow>     </tablelayout> </relativelayout> 

bg_tablerow11.xml:

<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">     <item         android:layout_width="10dp"         android:layout_height="10dp"         android:drawable="@drawable/arrow"         android:gravity="right" />     <item>         <shape             android:padding="10dp"             android:shape="rectangle">             <stroke                 android:width="2dp"                 android:color="#000000" />             <corners                 android:bottomleftradius="5dp"                 android:bottomrightradius="5dp"                 android:topleftradius="5dp"                 android:toprightradius="5dp" />         </shape>     </item>  </layer-list> 

thanks help.

a.j. :)

answer: content_main.xml:

<relativelayout     android:id="@+id/relativelayout"     android:layout_width="match_parent"     android:layout_height="50dp"     android:background="@drawable/bg_tablerow">      <textview         android:id="@+id/textview2"         android:layout_width="100dp"         android:layout_height="match_parent"         android:gravity="center"         android:text="@string/country"         android:textappearance="?android:attr/textappearancemedium" />      <textview         android:id="@+id/textview3"         android:layout_width="150dp"         android:layout_height="match_parent"         android:layout_alignparenttop="true"         android:layout_marginend="22dp"         android:layout_marginright="22dp"         android:layout_toleftof="@+id/imageview2"         android:layout_tostartof="@+id/imageview2"         android:gravity="center_vertical"         android:text="poland"         android:textappearance="?android:attr/textappearancemedium" />      <imageview         android:id="@+id/imageview2"         android:layout_width="30dp"         android:layout_height="30dp"         android:layout_alignparentend="true"         android:layout_alignparentright="true"         android:layout_centervertical="true"         android:layout_marginend="19dp"         android:layout_marginright="19dp"         android:background="@drawable/arrow"         android:scaletype="fitxy" />  </relativelayout> 

bg_tablerow.xml:

<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">     <item>         <shape android:shape="rectangle">             <solid android:color="#ffee00" />             <corners                 android:bottomleftradius="10dp"                 android:bottomrightradius="10dp"                 android:topleftradius="10dp"                 android:toprightradius="10dp" />             <stroke                 android:width="5dp"                 android:color="#eeaaff" />         </shape>     </item> </layer-list> 

Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -