我試圖在m TextView中呈現希伯來文字。android TextView不顯示希伯來語字體
我已閱讀here我需要將字體從默認的android改爲支持hebrew的字體。
我已經試過幾個解決方案,但他們沒有工作:
Typeface font= Typeface.createFromAsset(mContext.getAssets(), "fonts/Raanana.ttf");
titleTextView.setTypeface(font);
titleTextView.setText(mTitles[position]);
或:
titleTextView.setText(Html.fromHtml(mTitles[position]));
這裏是我的xml:
<ImageView
android:id="@+id/todo_row_image"
android:layout_width="50dp"
android:layout_height="30dp"
android:layout_marginBottom="32dp"
android:layout_marginLeft="21dp"
android:contentDescription="my image" />
<TextView
android:id="@+id/todo_row_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:lines="1"
android:text="@+id/titleTextView"
android:layout_toRightOf="@id/todo_row_image"
android:textSize="12sp" >
</TextView>
<TextView
android:id="@+id/todo_row_date"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/todo_row_title"
android:layout_marginTop="6dp"
android:lines="1"
android:text="@+id/dateTextView"
android:textSize="12sp" >
</TextView>
任何想法如何解決這個問題?
有沒有一種方法來定義每個應用程序的默認字體?每個佈局?
希伯來語一個TextView效果很好「開箱的」。也許有BIDI的問題,但通常它顯示它很好。 – Sean
就是這樣!我已經添加了我的xml。我該如何解決這個問題:圖像和兩行文字的權利:標題,日期? –