#author("2021-07-31T09:34:37+08:00","default:Admin","Admin") #author("2024-07-24T17:28:11+08:00","default:Admin","Admin") [[Android]] &color(red){※前提条件:本情報はAndroid Studio 4.2.2を基づいて説明してる}; #contents * 显示设置 [#b167a6dd] ** 修改显示文字 [#j6f88d6a] #codeprettify{{ TextView lblTitle=(TextView)findViewById(R.id.lblTitle); lblTitle.setText("这是显示的内容"); }} ** 显示超链接 [#effdcd79] #codeprettify{{ TextView lblTitle=(TextView)findViewById(R.id.lblTitle); lblTitle.setAutoLinkMask(Linkify.ALL); lblTitle.setText("<a href=\"http://www.baidu.com\">百度</>"); }} #codeprettify{{ <TextView android:id="@+id/lblTitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginLeft="88dp" android:layout_marginTop="51dp" android:autoLink="all" android:text="TextView" /> }} * 属性 [#mba39492] com.google.android.material.textview.MaterialTextView 具有许多常见的属性,以下是一些主要的: |android:text|设置显示的文本内容。| |android:textColor|文本颜色。| |android:textSize|文本大小。| |android:fontFamily|字体家族。| |android:gravity|文本的对齐方式。| |android:lineSpacingExtra|行间距额外增加的值。| |android:maxLines|最大显示行数。| |android:ellipsize|文本超出显示范围时的省略方式。| #hr(); コメント: #comment_kcaptcha