国产探花免费观看_亚洲丰满少妇自慰呻吟_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開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 鹤庆县| 花莲市| 井研县| 彰武县| 榆林市| 宝鸡市| 浦城县| 周至县| 丰城市| 嘉善县| 始兴县| 万全县| 黄大仙区| 随州市| 定南县| 北海市| 桂阳县| 通许县| 新巴尔虎右旗| 清水河县| 和硕县| 石屏县| 绥中县| 道孚县| 华坪县| 河津市| 永吉县| 漠河县| 汶上县| 陆川县| 镇平县| 湛江市| 敦化市| 清水县| 保靖县| 法库县| 双城市| 琼海市| 宁河县| 恩平市| 岗巴县|