国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Android > 正文

簡單學習Android TextView

2019-10-22 18:28:04
字體:
來源:轉載
供稿:網友

本文為大家分享了TextView的簡單學習資料,供大家參考,具體內容如下

XML的幾個特殊屬性

android:autoLink 用于指定是否將文本轉換成可點擊的超鏈接形式,它的屬性值有none,web,email,phone,map或all
android:drawBottom 用于將圖片添加到文本的低端 同理還有上,左,右
android:hint 當文本為空時,默認顯示的是什么
android:Grivaity 文本的對齊方式
android:inputType 顯示的文本類型

Mainactivity.XML代碼

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  xmlns:tools="http://schemas.android.com/tools"  android:layout_width="match_parent"  android:layout_height="match_parent"  android:paddingBottom="@dimen/activity_vertical_margin"  android:paddingLeft="@dimen/activity_horizontal_margin"  android:paddingRight="@dimen/activity_horizontal_margin"  android:paddingTop="@dimen/activity_vertical_margin"  android:orientation="vertical"  tools:context=".MainActivity" >  <TextView    android:id="@+id/textview1"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:hint="666"     />   <TextView    android:id="@+id/textview2"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:singleLine="true"    android:text="測試是否為單行模式"     />   <TextView    android:id="@+id/textview3"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:text="http://www.baidu.com"    android:autoLink="web"     /></LinearLayout>

mainACtivity.java

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  xmlns:tools="http://schemas.android.com/tools"  android:layout_width="match_parent"  android:layout_height="match_parent"  android:paddingBottom="@dimen/activity_vertical_margin"  android:paddingLeft="@dimen/activity_horizontal_margin"  android:paddingRight="@dimen/activity_horizontal_margin"  android:paddingTop="@dimen/activity_vertical_margin"  android:orientation="vertical"  tools:context=".MainActivity" >  <TextView    android:id="@+id/textview1"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:hint="666"     />   <TextView    android:id="@+id/textview2"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:singleLine="true"    android:text="測試是否為單行模式"     />   <TextView    android:id="@+id/textview3"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:text="http://www.baidu.com"    android:autoLink="web"     /></LinearLayout>

運行結果

Android,TextView

上述中的鏈接如果把apk導入到手機上真的能連接到百度,是不是很神奇….


注:相關教程知識閱讀請移步到Android開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 尼木县| 岑巩县| 彩票| 泰来县| 观塘区| 博乐市| 文水县| 临海市| 荔浦县| 宝坻区| 武强县| 富锦市| 荔浦县| 平顺县| 屯留县| 隆德县| 锦屏县| 乐陵市| 彭州市| 九江县| 辉南县| 定边县| 宁国市| 尼玛县| 永登县| 乐清市| 张家界市| 民县| 云梦县| 岑溪市| 东安县| 循化| 绍兴县| 江津市| 囊谦县| 云龙县| 康平县| 泰和县| 宾川县| 天柱县| 弥渡县|