当前位置: 首页 > news >正文

付费阅读网站代码文案写作软件app

付费阅读网站代码,文案写作软件app,nas无公网wordpress,mk厂手表网站TextView 文本框 用于显示文本的一个控件。文本的字体尺寸单位为 sp 。sp: scaled pixels(放大像素). 主要用于字体显示。 文本常用属性 属性名说明id为TextView设置一个组件id,根据id,我们可以在Java代码中通过 findViewById()的方法获取到该对象&…

TextView 文本框

  • 用于显示文本的一个控件。
  • 文本的字体尺寸单位为 sp 。
  • sp: scaled pixels(放大像素). 主要用于字体显示。

文本常用属性

属性名说明
id为TextView设置一个组件id,根据id,我们可以在Java代码中通过 findViewById()的方法获取到该对象,然后进行相关属性的设置
layout_width设置组件的宽度
layout_height设置组件的高度
gravity设置控件中内容的对齐方向,TextView中是文字,ImageView中是图片 等等
text设置显示的文本内容,一般我们是把字符串写到string.xml文件中,然后 通过@String/xxx取得对应的字符串内容的
textColor设置字体颜色,同上text一样,通过colors.xml资源来引用
textStyle设置字体风格,三个可选值:normal(无效果),bold(加粗),italic(斜 体)
textSize字体大小,单位一般是用sp
background控件的背景颜色,可以理解为填充整个控件的颜色,可以是图片
autoLink识别链接类型 (web, email, phone ,map ,none, all)

text设置示例

文本边框设置可以使用 shape。

带图片的TextView

示例图

代码

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".MainActivity"><TextViewandroid:id="@+id/a"android:layout_width="100dp"android:layout_height="100dp"android:text="微信"android:gravity="center"android:textSize="20sp"app:drawableTopCompat="@drawable/abc_name"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintStart_toStartOf="parent"app:layout_constraintHorizontal_bias="0.5"app:layout_constraintEnd_toStartOf="@+id/b" /><TextViewandroid:id="@+id/b"android:layout_width="100dp"android:layout_height="100dp"android:text="通讯录"android:gravity="center"android:textSize="20sp"app:drawableTopCompat="@drawable/abc_name"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintStart_toEndOf="@+id/a"app:layout_constraintHorizontal_bias="0.5"app:layout_constraintEnd_toStartOf="@+id/c" /><TextViewandroid:id="@+id/c"android:layout_width="100dp"android:layout_height="100dp"android:text="发现"android:gravity="center"android:textSize="20sp"app:drawableTopCompat="@drawable/abc_name"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintStart_toEndOf="@+id/b"app:layout_constraintHorizontal_bias="0.5"app:layout_constraintEnd_toStartOf="@+id/d" /><TextViewandroid:id="@+id/d"android:layout_width="100dp"android:layout_height="100dp"android:text="我"android:gravity="center"android:textSize="20sp"app:drawableTopCompat="@drawable/abc_name"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintStart_toEndOf="@+id/c"app:layout_constraintHorizontal_bias="0.5"app:layout_constraintEnd_toEndOf="parent" /></androidx.constraintlayout.widget.ConstraintLayout>

EditText 输入框

EditText 输入框,集成TextView, 也继承其属性

EditText 属性

属姓名说明
android:hint默认提示文本
android:textColorHint默认提示文本的颜色
android:selectAllOnFocus布尔值。点击输入框获得焦点后,选中输入框中所有的文本内容
android:inputType对输入的数据进行限制
android:minLines设置最小行数
android:maxLines设置最大行数,当输入内容超过maxline,文字会自动向上 滚动!!
android:singleLine只允许单行输入,而且不会滚动
android:textScaleX设置字与字的水平间隔
android:textScaleY设置字与字的垂直间隔
android:capitalizesentences:仅第一个字母大写 ;words:每一个单词首 字母大小,用空格区分单词;characters:每一个英文字母 都大写

输入框类型

文本类型,大写、小写、数字符合

android:inputType="none"
android:inputType="text"
android:inputType="textCapCharacters"
android:inputType="textCapWords"
android:inputType="textCapSentences"
android:inputType="textAutoCorrect"
android:inputType="textAutoComplete"
android:inputType="textMultiLine"
android:inputType="textImeMultiLine"
android:inputType="textNoSuggestions"
android:inputType="textUri"
android:inputType="textEmailAddress"
android:inputType="textEmailSubject"
android:inputType="textShortMessage"
android:inputType="textLongMessage"
android:inputType="textPersonName"
android:inputType="textPostalAddress"
android:inputType="textPassword"    // 密码类型
android:inputType="textVisiblePassword"
android:inputType="textWebEditText"
android:inputType="textFilter"
android:inputType="textPhonetic"

数值类型

android:inputType="number"
android:inputType="numberSigned"
android:inputType="numberDecimal"
android:inputType="phone"//拨号键盘
android:inputType="datetime"
android:inputType="date"//日期键盘
android:inputType="time"//时间键盘
    @Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);EditText editText = findViewById(R.id.edName);editText.requestFocus();	// 自动过去光标editText.setSelection(2);	// 光标自动显示在指定的下标的位置editText.clearFocus();		// 清除光标}

http://www.yidumall.com/news/26809.html

相关文章:

  • 国外的室内设计网站武汉seo优化
  • 自己做网站用什么软件下载大数据比较好的培训机构
  • 昆明建设银行纪念币预约网站站长之家官网登录入口
  • 做网站需要空间竞价外包代运营公司
  • php做的网站模板下载百度热搜的含义
  • 网站建设代码走查销售成功案例分享
  • 广州手机网站建设联系电话西安网站推广慧创科技
  • 大理建设工程信息网站黄石seo
  • 以春天为主题的网站建设资源百度网盘app下载安装 官方下载
  • 宝安区城市建设局网站企业所得税优惠政策
  • 广元网站建设工作室百度快照收录
  • 关于美食html网页设计实例代码西安优化外
  • 购物网站 后台模板登录百度
  • 每日聚划算优惠网站怎么做的优秀软文营销案例
  • 宁波网站建设工作全网推广哪家正宗可靠
  • 江门网站制作培训学校如何联系百度客服
  • h5+css3+网站开发实例360优化大师安卓手机版下载安装
  • 龙岗商城网站建设个人网站设计方案
  • 网站建设代理公司站长
  • 网站建设 项目背景企业培训内容
  • 易搜网站建设如何进行搜索引擎优化
  • 义乌网站建设制作商网络营销案例100例
  • 携程旅行网站建设分析广州推广seo
  • 怎样开通网站百度指数怎么算
  • 西充县住房和城乡规划建设局网站广州做网站的公司哪家好
  • 大型网站怎么做优化武汉搜索推广
  • 遵义住房和城乡建设厅网站网络销售靠谱吗
  • wordpress 修改仪表盘公司seo是指什么意思
  • 郑州英文网站建设最好用的搜索引擎排名
  • 移动端和桌面端是什么意思青岛seo结算