解决android红边框的问题

添加以下两个属性:

persist.sys.strictmode.visual=0 

persist.sys.strictmode.disable=1 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你可以在Android Studio中通过创建drawable资源文件来给按钮或文本编辑框添加边框。在创建的drawable资源文件中,你可以设置边框的颜色、宽度和形状等属性。具体的步骤如下: 1. 在res目录下的drawable文件夹中右击,选择"New" -> "Drawable resource file"。 2. 给这个文件起一个名字,例如"round_button"。 3. 在该文件中输入相应的XML代码,用来定义边框的样式和属性。例如: ```xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <!-- 设置实体颜色为白色 --> <solid android:color="#FFFFFF" /> <!-- 设置边框的颜色为蓝色,边框宽度为1dip --> <stroke android:width="1dip" android:color="@color/blue" /> <!-- 设置组件的四个边角的圆角半径 --> <corners android:radius="3dp" android:bottomLeftRadius="15dp" android:bottomRightRadius="15dp" android:topLeftRadius="15dp" android:topRightRadius="15dp" /> </shape> ``` 4. 在布局文件中给按钮或文本编辑框组件设置背景属性,引用刚才创建的资源文件。例如: ```xml <EditText android:id="@id/ed1" android:layout_width="358dp" android:layout_height="30dp" android:background="@drawable/round_button" android:layout_gravity="center" android:layout_marginLeft="10dp" android:ellipsize="end" android:gravity="center" android:hint="搜索" android:imeOptions="actionSearch" android:inputType="textPersonName" android:maxLines="1" android:singleLine="true" android:text="请输入内容" android:textSize="15sp" /> ``` 至于相关问题,请告诉我您还有哪些和边框有关的问题,我将为您解答。 相关问题: 1. 如何在Android Studio中给按钮添加边框? 2. 如何自定义边框的颜色和宽度? 3. 如何给文本编辑框添加圆角边框

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值