
在名为cardlayout.xml的可绘制文件夹中创建XML drawable
<?xml version="1.0" enCoding="utf-8"?><@R_980_3419@ xmlns:androID="http://schemas.androID.com/apk/res/androID"> <item> <shape androID:shape="rectangle"> <gradIEnt androID:angle="90" androID:endcolor="@color/background_gray" androID:startcolor="#ccc" /> <corners androID:radius="4dp" /> </shape> </item> <item androID:left="0dp" androID:right="1.5dp" androID:top="0dp" androID:bottom="1.5dp"> <shape androID:shape="rectangle"> <solID androID:color="@androID:color/white"/> <corners androID:radius="4dp" /> </shape> </item></@R_980_3419@>
现在将此drawable添加为您想要提升的任何视图中的背景.
为了更好地查看,您可以制作父布局的背景颜色androID:background =“#d9d7d7”
为了快速举例,我分享了我项目的2个文件:
这是具有#d9d7d7背景颜色的活动
<?xml version="1.0" enCoding="utf-8"?><relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:orIEntation="vertical" > <linearLayout androID:ID="@+ID/rel" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:background="#d9d7d7" androID:orIEntation="horizontal" > <TextVIEw androID:ID="@+ID/text" androID:layout_wIDth="65dp" androID:layout_height="25dp" androID:layout_marginleft="10dp" androID:layout_marginRight="5dp" androID:layout_margintop="5dp" androID:layout_marginBottom="5dp" androID:background="@drawable/bg_green" androID:gravity="center" androID:padding="0dp" androID:text="" androID:textcolor="#FFFFFF" androID:textSize="14dp" androID:textStyle="bold" /> <TextVIEw androID:ID="@+ID/Title" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:layout_margin="5dp" androID:padding="10dp" androID:text="Jobs has been applIEd" androID:textSize="15dp" androID:textStyle="bold" /> </linearLayout> <ListVIEw androID:ID="@+ID/ListVIEw1" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:divIDer="@androID:color/transparent" androID:divIDerHeight="10.0sp" androID:layout_marginleft="10dp" androID:layout_marginRight="13dp" androID:layout_margintop="10dp" androID:layout_below="@+ID/rel" > </ListVIEw></relativeLayout>
而这一个是带有高程的ListRow xml.
<?xml version="1.0" enCoding="utf-8"?><relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:orIEntation="vertical" androID:padding="7dp" androID:background="@drawable/cardlayout" androID:paddingBottom="10dp"> <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:ID="@ID/center" androID:text="" androID:layout_centerInParent="true"/> <relativeLayout androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:layout_marginRight="-30dp" androID:ID="@+ID/leftlayout1" androID:layout_toleftOf="@+ID/center" > <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:ID="@+ID/sl" androID:visibility="gone" androID:textSize="10dp" androID:text="1"/> <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="Bdjobs.com Ltd." androID:textcolor="#68AA47" androID:textSize="13dp" androID:layout_below="@+ID/sl" androID:textStyle="bold" androID:layout_marginleft="10dp" androID:layout_margintop="10dp" androID:ID="@+ID/companyname"/> <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="Mobile App Developer" androID:layout_below="@+ID/companyname" androID:textcolor="#1457A1" androID:textSize="14dp" androID:textStyle="bold" androID:layout_marginleft="10dp" androID:layout_margintop="3dp" androID:ID="@+ID/position"/> <TextVIEw androID:layout_wIDth="120dp" androID:layout_height="wrap_content" androID:text="ApplIEd on:11-14-2014" androID:layout_below="@+ID/position" androID:textcolor="#222222" androID:textSize="12dp" androID:padding="4dp" androID:layout_marginleft="7dp" androID:layout_margintop="0dp" androID:ID="@+ID/applydate"/> <TextVIEw androID:layout_wIDth="120dp" androID:layout_height="wrap_content" androID:text="Deadline: 11-14-2014" androID:layout_below="@+ID/applydate" androID:textcolor="#222222" androID:textSize="12dp" androID:padding="4dp" androID:layout_marginleft="7dp" androID:layout_margintop="0dp" androID:ID="@+ID/deadlineApp"/> <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:textcolor="#FFFFFF" androID:textSize="10dp" androID:layout_toRightOf="@+ID/companyname" androID:visibility="invisible" androID:padding="8dp" androID:background="#536d7a" androID:layout_marginleft="10dp" androID:layout_margintop="10dp" androID:ID="@+ID/jobIDApplIEd"/> </relativeLayout> <relativeLayout androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:ID="@+ID/rightlayout1" androID:paddingRight="16dp" androID:layout_marginleft="30dp" androID:layout_toRightOf ="@+ID/center" > <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="Expected Salary" androID:layout_marginleft="10dp" androID:layout_margintop="10dp" androID:textSize="12dp" androID:textcolor="#111111" androID:ID="@+ID/exp"/> <TextVIEw androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:text="100000/-" androID:layout_below="@+ID/exp" androID:layout_marginleft="10dp" androID:layout_margintop="0dp" androID:textSize="12dp" androID:textcolor="#999999" androID:ID="@+ID/expectedsalary"/> <TextVIEw androID:layout_wIDth="150dp" androID:layout_height="wrap_content" androID:text="VIEwed by Employer" androID:layout_marginleft="10dp" androID:layout_margintop="20dp" androID:textSize="11dp" androID:textStyle="bold" androID:gravity="center" androID:layout_alignParentRight="true" androID:padding="7dp" androID:background="@drawable/border_delete" androID:textcolor="#ffffff" androID:layout_below="@+ID/expectedsalary" androID:ID="@+ID/vIEwdresume"/> </relativeLayout></relativeLayout>总结
以上是内存溢出为你收集整理的应用具有android高程的阴影全部内容,希望文章能够帮你解决应用具有android高程的阴影所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)