導航:首頁 > 操作系統 > 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下劃線相關的資料

熱點內容
文件夾快速查找表格不同內容 瀏覽:491
合並排序演算法java 瀏覽:916
如何將文件夾刪除的部分恢復 瀏覽:808
eco為什麼連接不上伺服器 瀏覽:292
查看linux的命令是 瀏覽:10
蘋果郵件伺服器地址 瀏覽:341
U盤超級加密3000時間 瀏覽:737
如何跟別人解釋什麼是伺服器 瀏覽:937
安卓11原生如何隱藏軟體 瀏覽:710
解壓清潔面部女士 瀏覽:854
美的變頻空調壓縮啟動一下報p1 瀏覽:470
濟南如何申請app多少錢 瀏覽:164
帶加密功能的u盤啟動盤製作 瀏覽:819
計算機編程知識 瀏覽:435
c語言編程軟體都有哪些 瀏覽:157
解壓一半可以取消嘛 瀏覽:121
住宅風水pdf 瀏覽:240
文件夾rundir什麼意思 瀏覽:973
戴爾電腦如何給硬碟加密 瀏覽:158
androidn版本特性 瀏覽:932