【发布时间】:2012-12-23 18:44:11
【问题描述】:
请看下面的代码
<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 的文本设置为 Bold,如果可能的话,添加一个文本设计,比如“spread”、“spoiled”、“blur”。
我该怎么做?将文本加粗是主要问题,如果您可以回答第二个问题。
谢谢
【问题讨论】:
-
android:TextStyle="bold"(见developer.android.com/reference/android/widget/…)
-
to bold|italic|normal a text is android textifield 是原生属性,但要添加自定义功能,您必须以编程方式添加它
-
看看下面的链接jappit.com/blog/2009/01/25/…
标签: java android eclipse fonts textview