gpt4 book ai didi

java - 将 TextView 设为粗体并添加文本设计

转载 作者:行者123 更新时间:2023-12-02 00:05:19 24 4
gpt4 key购买 nike

请看下面的代码

<RelativeLayout 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:descendantFocusability="afterDescendants"
android:background="@drawable/background1"
tools:context=".Form" >

<TextView
android:id="@+id/txt1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/dateTxt"
android:textSize="32sp"
android:textColor="#FFFFFF"
android:layout_alignParentLeft="true"

/>

<DatePicker
android:id="@+id/datePick"
android:layout_toRightOf="@+id/txt1"
android:layout_width="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
/>

</RelativeLayout>

在这里,我需要将 TextView 的文本设置为粗体,如果可能的话,添加诸如“展开”、“破坏”、“模糊”之类的文本设计。

我该怎么做?将文本加粗是主要问题,如果可以的话请回答第二个问题。

谢谢

最佳答案

TextView t1=(TextView)findViewById(R.layout.TextView01);
t1.setTypeface(null,Typeface.BOLD);

对于设计,从中获得一些想法.. http://mobile.tutsplus.com/tutorials/android/android-user-interface-design-basic-font-sizes/

关于java - 将 TextView 设为粗体并添加文本设计,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14013650/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com