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

熱點內容
手機什麼解壓器最好 瀏覽:49
什麼是適合自己的app 瀏覽:451
雲伺服器怎麼補漏洞 瀏覽:176
如何看自己的安卓是什麼等級 瀏覽:633
被丁磊挖走的程序員 瀏覽:19
gsk980ta編程 瀏覽:507
單片機離線 瀏覽:84
解壓助眠敲擊外國長指甲 瀏覽:421
3次元編程 瀏覽:803
夫妻傳送英文命令 瀏覽:316
程序員題代做 瀏覽:950
戴爾伺服器怎麼擴大內存 瀏覽:641
解壓包密碼消失 瀏覽:135
昆侖通態觸摸屏用戶窗加密 瀏覽:564
農信app怎麼看日額 瀏覽:865
iphone備忘錄包含視頻無法加密 瀏覽:283
抖音快手紅包源碼 瀏覽:137
程序員資源分析 瀏覽:586
linux交換分區大小 瀏覽:922
mt怎麼編譯 瀏覽:337