如何更改a中的字体TextView,默认显示为Arial?如何将其更改为Helvetica?
谁能告诉我文本出了什么问题?长于一行的文本不会换行到下一行但超出屏幕.
以下是代码:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="4dip">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="4dip">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="4dip">
<TextView
android:id="@+id/reviewItemEntityName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="event/venue"
android:textColor="@color/maroon"
android:singleLine="true"
android:ellipsize="end"
android:textSize="14sp"
android:textStyle="bold"
android:layout_weight="1" />
<ImageView
android:id="@+id/reviewItemStarRating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:src="@drawable/title_1_star" />
</LinearLayout>
<TextView
android:id="@+id/reviewItemDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Description comes here"
android:textSize="12sp"
android:layout_weight="1"/>
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud) 我花了很多时间寻找解决方案,但没有找到任何与我遇到的相似的东西.当我在我的G2上运行我的应用程序时,没有任何文本视图包装文本.(无论视图有多大.)如果我在模拟器上运行它们,它们会适当地换行.当我的其他应用程序部署到我的G2时似乎没有这个问题.我有电源循环我的设备,重新创建布局等.这似乎甚至影响这个特定应用程序中的标准警报对话框.它发生在我的所有活动中.有没有人见过这样的事情,或者有没有人知道我应该看什么?
一些代码按要求...
AlertDialog.Builder eula = new AlertDialog.Builder(activity)
.setTitle(R.string.eula_title)
.setIcon(android.R.drawable.ic_dialog_info)
.setMessage(R.string.eula_text)
.setCancelable(accepted)
.setPositiveButton(R.string.eula_accept,
new android.content.DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
setAcceptedEula(activity);
dialog.dismiss();
mHandler.post(mSplashScreen.launch);
}
})
.setNegativeButton(R.string.eula_decline,
new android.content.DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
activity.finish();
}
});
eula.show();
Run Code Online (Sandbox Code Playgroud)
标准警报对话框不会包装文本.它显示了一条跟踪视图的线.