
我想以圆圈的形式进行相对布局.我不想使用画布,因为我无法处理画布中的可点击事件.我希望每个事件(例如鼠标单击等)仅在该圆圈内执行.圈子中,不应执行任何布局事件.
我有以下代码,circle.xml
<?xml version="1.0" enCoding="utf-8"?><shape xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:shape="oval"> <solID androID:color="@androID:color/white"/> <size androID:wIDth="10dp" androID:height="10dp"/></shape>,img.xml
<?xml version="1.0" enCoding="utf-8"?><@R_850_3419@ xmlns:androID="http://schemas.androID.com/apk/res/androID" > <item androID:drawable="@drawable/circle"/></@R_850_3419@>,布局
<relativeLayout androID:ID="@+ID/test_layout" androID:layout_wIDth="700px" androID:layout_height="700px" androID:background="@drawable/img" />但是这段代码是在相对布局的背景上设置圆形,以矩形的形式出现,无论我添加到相对布局的事件是在圆形之外执行的,我希望整个布局都是圆形的,我该怎么做? .
解决方法:
创建一个xml文件并添加drawable文件夹
<?xml version="1.0" enCoding="utf-8"?> <shape xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:shape="oval" > <solID androID:color="#65BF59"/> <!-- this one is ths color of the Rounded button --> <corners androID:bottomrighTradius="100dp" androID:bottomLefTradius="100dp" androID:topLefTradius="100dp" androID:topRighTradius="100dp"/> </shape> 在布局的背景中使用此文件.
总结以上是内存溢出为你收集整理的android-以圆形形式的相对布局全部内容,希望文章能够帮你解决android-以圆形形式的相对布局所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)