导航:首页 > 操作系统 > android去除边框

android去除边框

发布时间:2022-12-23 00:53:16

android 如何去掉edittext边框

java">将edittext的style设置成?android:attr/textViewStyle取消掉默认的样式,在设置background为@null接下来就是一个空空的edittext了(比如http://www.tiecou.com/)
,在两个edittext中间加一个view,设置background为灰色,宽度match_parent,高度2dip看看。

RelativeLayoutxmlns:android="

xmlns:tools="

android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/darker_gray">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@android:color/white"
android:orientation="vertical">

<EditText
style="?android:attr/textViewStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:hint="输入用户名"
android:paddingBottom="5dip"
android:paddingTop="5dip"/>

<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="@android:color/darker_gray"/>

<EditText
style="?android:attr/textViewStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:hint="输入密码"
android:inputType="textPassword"
android:paddingBottom="5dip"
android:paddingTop="5dip"/>
</LinearLayout>
</RelativeLayout>

② 安卓手机左边悬浮框怎么彻底去掉.烦死了,在线等

建议进行以下操作:1.拉下手机顶帘菜单-关闭多窗口开关(进入手机设定-显示-多窗口去掉勾选)
2.如果为第三方类似本机多窗口应用,您可卸载手机中安装的手机管家、安全卫士之类的手机管理软件
3.备份手机数据(电话簿、短信息、多媒体文件等),恢复出厂设置(进入手机设定--重置-恢复出厂设定)
如果恢复出厂设置问题依然存在,建议将手机送至就近的三星服务中心进行检测及进一步处理。

③ 之如何去除android上a标签产生的边框

在android手机中,当处于模块一状态时,用户触摸到“查看按钮”,a标签的边框显示出来,这明显不是我们要想要的体验。


最后跟产品经理沟通后,针对android手机去除上图的按钮边框,那么如何去除android手机自带的按钮边框呢?


在搜索引擎中找到资料-webkit-tap-highlight-color可以去除边框,如下图:


排除误解


网络资料说这个属性只用于iOS(iPhone和iPad),其实是错误的,android手机大部分也是支持的,只是显示效果不一样,移动开发并不成熟,更多的还需要大家去实践来辨别真伪- -


-webkit-tap-highlight-color用法


webkit内核的浏览器,当用户点击一个链接或者通过js定义的可点击元素的时候,会出现一个半透明的灰色背景或者红色的边框。


如果想要禁用高亮,可设置颜色的alpha值为0,也就是属性值的最后一位设置为0就可以去除背景或者边框。


去除android链接触摸时产生边框的css代码


a,button,input{-webkit-tap-highlight-color:rgba(255,0,0,0);}/* 1.去除android a/button/input标签被点击时产生的边框 2.去除ios a标签被点击时产生的半透明灰色背景 */

转载

④ android 如何去掉edittext上边框

将edittext的style设置成?android:attr/textViewStyle 取消掉默认的样式,在设置background为@null接下来就是一个空空的edittext了(比如http://www.tiecou.com/)
, 在两个edittext中间加一个view,设置background为灰色,宽度match_parent,高度2dip看看。

RelativeLayout xmlns:android="

xmlns:tools="

android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/darker_gray" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@android:color/white"
android:orientation="vertical" >

<EditText
style="?android:attr/textViewStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:hint="输入用户名"
android:paddingBottom="5dip"
android:paddingTop="5dip" />

<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="@android:color/darker_gray" />

<EditText
style="?android:attr/textViewStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:hint="输入密码"
android:inputType="textPassword"
android:paddingBottom="5dip"
android:paddingTop="5dip" />
</LinearLayout>
</RelativeLayout>

⑤ android黑色边框如何去掉

这是控件的background。如果你使用的是系统默认空间那么它会指定一个默认的背景选择器。这样实现了多张图片在点击和焦点状态下的效果。
这个黑框是图片的一个边框。如果把background自定为透明那么连图片效果也没有了
解决的办法就是,用一组新的无边框图片去覆盖掉系统默认的background

因为android代码开源所以你可以通过查看这个控件的源码来详细了解background如何设置上去的。

⑥ android button边框怎么去掉

设置为无背景
android:background="@null"

方法二:
将背景改为
android:background="#00000000"

这里00000000为透明

⑦ Android EditText如何去除边框添加下划线

废话不多说了,直接给大家贴代码了。

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<!--注意名称 -->
<com.marine.study.LineEditText
android:id="@+id/myEdit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="?android:attr/textViewStyle"
android:background="@null"
android:textColor="@null"
/>
</LinearLayout>

其中background,可以设置成其他颜色等

textColor不一定要是null,可以设置字体颜色
加下划线

public class LineEditText extends EditText {
// 画笔 用来画下划线
private Paint paint;
public LineEditText(Context context, AttributeSet attrs) {
super(context, attrs);
paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setColor(Color.RED);
// 开启抗锯齿 较耗内存
paint.setAntiAlias(true);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// 得到总行数
int lineCount = getLineCount();
// 得到每行的高度
int lineHeight = getLineHeight();
// 根据行数循环画线
for (int i = 0; i < lineCount; i++) {
int lineY = (i + 1) * lineHeight;
canvas.drawLine(0, lineY, this.getWidth(), lineY, paint);
}
}
}

以上内容给大家介绍了Android中EditText如何去除边框添加下划线的相关内容,希望对大家有所帮助!

⑧ 如何写Android程序去掉最上面的头框

在AndroidManifest.xml中实现:
注册Activity时加上如下的一句配置就可以实现。
android:theme="@android:style/Theme.NoTitleBar"
>

⑨ android如何去掉button的边框

将背景改为
android:background="#00000000"

这里00000000为透明

⑩ android怎么让button去掉边框

使用资源文件shape定义背景(background)
下图是安卓无忧中的例子,可以看里面的源码还有文档,大部分形状都可以定义,请看截图:
在Android程序开发中,我们经常会去用到Shape这个东西去定义各种各样的形状,首先我们了解一下
Shape下面有哪些标签,都代表什么意思:
1.1
solid:填充
android:color指定填充的颜色
1.2
gradient:渐变
android:startColor和android:endColor分别为起始和结束颜色,
android:angle是渐变角度,必须为45的整数倍。
另外渐变默认的模式为android:type="linear",即线性渐变,
可以指定渐变为径向渐变,android:type="radial",径向渐变需要指定半径android:gradientRadius="50"。
angle值对应的位置如图:
1.3
stroke:描边
android:width="2dp"
描边的宽度,android:color
描边的颜色。
我们还可以把描边弄成虚线的形式,设置方式为:
android:dashWidth="5dp"
android:dashGap="3dp"
其中android:dashWidth表示'-'这样一个横线的宽度,android:dashGap表示之间隔开的距离
1.4
corners:圆角
android:radius为角的弧度,值越大角越圆。
我们还可以把四个角设定成不同的角度,
同时设置五个属性,则Radius属性无效
android:Radius="20dp"
设置四个角的半径
android:topLeftRadius="20dp"


设置左上角的半径
android:topRightRadius="20dp"
设置右上角的半径
android:bottomLeftRadius="20dp"


设置右下角的半径
android:bottomRightRadius="20dp"

设置左下角的半径
padding:间隔
可以设置上下左右四个方向的间隔
ps:为了方便交流看一下我名字中文和除了中文以外的。

阅读全文

与android去除边框相关的资料

热点内容
android短信验证码倒计时 浏览:641
排课走班源码 浏览:222
程序员刚毕业去了小公司有发展吗 浏览:90
速腾怎么安装安卓手机互联 浏览:143
linux设备驱动程序代码 浏览:301
服务器的功耗怎么看 浏览:651
app组件哪里找 浏览:87
androidqq红包 浏览:412
服务器如何传输 浏览:456
如何快速将多个文件夹快速解压缩 浏览:114
程序员睡前都在想什么 浏览:37
少儿编程技能培训心得 浏览:458
白命令 浏览:816
headfirstjavapdf 浏览:552
广数980t怎么编程 浏览:592
无邪app在哪里下载 浏览:462
mac自带php目录 浏览:632
海淘小程序源码 浏览:750
哪里下载苏宁秒达app 浏览:643
androidcmnet 浏览:31