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

熱點內容
如何自己編譯android系統 瀏覽:786
phpmysqlpdomysqli 瀏覽:802
php修改sql語句 瀏覽:714
android有道api 瀏覽:381
撓耳營水表用的什麼app 瀏覽:49
戰錘40kpdf 瀏覽:375
java判斷字元串是漢字 瀏覽:462
2017初級教材pdf 瀏覽:451
松下空調壓縮機品牌 瀏覽:817
python復選框 瀏覽:748
反詐中心app是什麼時候出來的 瀏覽:586
魔獸世界需要什麼伺服器地址 瀏覽:189
啥是單片機休眠 瀏覽:104
什麼音樂app最好 瀏覽:929
牙膏自製解壓神器 瀏覽:329
卸載linuxwps 瀏覽:228
threadjavarunnable 瀏覽:360
一元線性回歸計演算法 瀏覽:950
刷寶app是什麼鬼 瀏覽:744
linux動態載入模塊 瀏覽:25