導航:首頁 > 操作系統 > 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去除邊框相關的資料

熱點內容
松餅pdf 瀏覽:667
萌新如何獲得命令 瀏覽:138
java設計模式及代碼 瀏覽:7
命令恢復資料庫 瀏覽:192
linuxoracle11gr2 瀏覽:972
攜程APP簽到在哪裡 瀏覽:389
dwg解壓方法 瀏覽:422
雲伺服器數據溝通 瀏覽:849
android地圖定位源碼 瀏覽:632
鴻蒙系統如何解除app安裝限制 瀏覽:497
阿里雲伺服器應用鏡像選哪個 瀏覽:343
win7策略更新命令 瀏覽:299
android源碼分析之設計模式 瀏覽:294
qq郵箱上的文件怎麼解壓在電腦上 瀏覽:504
業余學python是如何掙錢的 瀏覽:416
方舟伺服器連接超時顯示什麼 瀏覽:226
php繪制emoji 瀏覽:35
安卓桌面工具怎麼刪除 瀏覽:54
外六角螺絲套頭演算法 瀏覽:838
程序員特殊招數是什麼意思 瀏覽:352