简体   繁体   English

Android图层列表排列

[英]Android Layer-list arrangment

i am using the following layer-list file to make a background image. 我正在使用以下图层列表文件制作背景图像。

Layer-list: 层列表:

<?xml version="1.0" encoding="utf-8"?>
<!--  <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
        android:src="@drawable/bgpattern"
        android:tileMode="repeat"
         /> -->
         <layer-list xmlns:android="http://schemas.android.com/apk/res/android"

             >
           <item >      
              <bitmap 
                   android:src="@drawable/bgpattern"
                   android:tileMode="repeat"

         />   
               </item>    

               <item android:drawable="@drawable/trans"

                   >      
              </item> 
              <item  android:bottom="2dp" android:left="2dp" >      
                   <bitmap 
                   **android:src="@drawable/colordots"**
                   android:gravity="bottom"

         />   
              </item> 

      </layer-list>

but the android:src="@drawable/colordots image is appearing at center bottom of the screen i need it to be appear at the left-bottom of the screen. how can i do that can any one help me in doing this. the android:left="2dp" is not taking. 但是android:src =“ @ drawable / colordots图像出现在屏幕的中央底部,我需要它出现在屏幕的左下角。我该怎么做,任何人都可以帮助我做到这一点。 android:left =“ 2dp”无法使用。

尝试<bitmap android:gravity="left|bottom"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM