在XML Android中添加背景图像以进行整形

在XML Android中添加背景图像以进行整形,第1张

概述如何在形状中添加背景图像?我在下面尝试的代码但没有成功:<?xmlversion="1.0"encoding="utf-8"?><shapexmlns:android="http://schemas.android.com/apkes/android"android:shape="rectangle"android:padding="10dp">//herei

如何在形状中添加背景图像?我在下面尝试的代码但没有成功:

<?xml version="1.0" enCoding="utf-8"?><shape xmlns:androID="http://schemas.androID.com/apk/res/androID"androID:shape="rectangle" androID:padding="10dp">//here is where i need to set the image<solID androID:color="@drawable/button_image"/>    <corners     androID:bottomrighTradius="5dp"     androID:bottomLefTradius="5dp"     androID:topLefTradius="5dp"     androID:topRighTradius="5dp"/> </shape>

解决方法:

使用以下层列表:

<?xml version="1.0" enCoding="utf-8"?><@R_570_3419@ xmlns:androID="http://schemas.androID.com/apk/res/androID" >    <item>        <shape androID:shape="rectangle" androID:padding="10dp">            <corners                 androID:bottomrighTradius="5dp"                 androID:bottomLefTradius="5dp"                 androID:topLefTradius="5dp"                 androID:topRighTradius="5dp"/>         </shape>   </item>   <item androID:drawable="@drawable/image_name_here" /></@R_570_3419@>
总结

以上是内存溢出为你收集整理的在XML Android中添加背景图像以进行整形全部内容,希望文章能够帮你解决在XML Android中添加背景图像以进行整形所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1103887.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存