<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#288FFFEE"
tools:context=".MainActivity">
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/str1"
android:textSize="36sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/str1"
android:textSize="36sp"
android:textColor="@color/colorPrimary"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="https://www.baidu.com"
android:autoLink="web"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Baidu网址: https://www.baidu.com"
android:textSize="24dp"
android:autoLink="web"
android:linksClickable="false"
android:minLines="2"
android:maxLines="3"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" 百度(纳斯达克:BIDU)是全球最大的中文搜索引擎,中国最大的以信息和知识为核心的互联网综合服务公司,全球领先的人工智能平台型公司。"
android:singleLine="true"
android:ellipsize="middle"
android:textSize="18dp"
/>
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Baidu 百度"
android:singleLine="true"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:textSize="36dp"
android:textColor="@color/colorPrimary"
/>
(2)EditView用法:
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Baidu百度"
android:maxLength="5"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="搜索或输入网址"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:selectAllOnFocus="true"
android:text="http://www."
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="phone"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits="1234567890abc"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@mipmap/ic_l1"
android:drawablePadding="10dp"
android:editable="false"
/>
运行截图:
<EditText
android:id="@+id/e_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPersonName"
android:textSize="20sp"
android:imeOptions="actionNext"
android:hint="QQ号/手机号/邮箱"/>
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="numberPassword"
android:textSize="20sp"
android:imeOptions="actionDone"
android:hint="输入密码"/>
本文地址:https://blog.csdn.net/weixin_43362360/article/details/107470597
如对本文有疑问, 点击进行留言回复!!
LongClick原理、上下文菜单原理、EditText长按弹窗原理、WebView长按弹窗自定义、修复WebView全选重复bug ———————————————— 版权声明:本文为CSDN博主「
JobScheduler 实现 特定时间,特定条件(系统空闲,电池电量,磁盘空间 ……)下执行任务
网友评论