導航:首頁 > 操作系統 > androidxml下劃線

androidxml下劃線

發布時間:2023-06-10 13:45:29

⑴ 安卓手機怎麼打出下劃線

手機上打出下劃線步驟:

1、以MIUI系統為例,打開MIUI系統輸入法鍵盤頁面,點擊頁面左下角「符」按鈕;

android 怎麼在程代碼中給textview加下邊框xml方式我已會了!

給TextView加下邊框是不是就是在TetView下面劃一條線,如果是這樣的話方法有很多:相對布局、透明圖片、重寫onDraw都可以,我告訴你個及其取巧的方法:
1.tv.setText(Html.fromHtml("<b>附件:</b>"
+ "<a href=\"http://www.google.com\">"+這里填寫TextView的值+"</a>"));
2.tv.setMovementMethod(LinkMovementMethod.getInstance());
這是可以跳轉的,如果不要執行跳轉動作,把第2條語句注釋掉

⑶ 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如何去除邊框添加下劃線的相關內容,希望對大家有所幫助!

閱讀全文

與androidxml下劃線相關的資料

熱點內容
快手應用加密怎麼開 瀏覽:805
女生26歲轉行做程序員可以嗎 瀏覽:570
程序員崗位工作規劃 瀏覽:252
指定伺服器地址 瀏覽:49
女程序員返鄉回東北 瀏覽:383
河南安陽電信伺服器雲空間 瀏覽:721
androidadbsocket 瀏覽:876
python深入學習預測 瀏覽:596
linuxmd5加密命令 瀏覽:3
linuxboot安裝 瀏覽:884
createtablephp 瀏覽:269
單片機原理和應用 瀏覽:368
蘋果id雲伺服器地址 瀏覽:300
javac編譯通過不顯示漢字 瀏覽:507
單片機鋰電 瀏覽:169
程序員長得美 瀏覽:975
單片機rgb燈4腳 瀏覽:316
php執行mysql查詢 瀏覽:543
程序員在深圳找工作 瀏覽:578
江蘇伺服器託管虛擬主機雲伺服器 瀏覽:958