簡體   English   中英

在某些較小的屏幕尺寸下,Malayalam文本在TextView中不可見。 (英文文本沒有問題)

[英]Malayalam text goes out of view in TextView, in some smaller screen sizes. (No issues with English text)

我有一個從RSS提要中獲取馬拉雅拉姆文字的應用程序。

為了簡潔起見,我將使用帶有靜態文本的簡單應用程序來解釋我的問題。

碼:

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        TextView textView=(TextView) (findViewById(R.id.textview1));

        String text=" സഭ പരിശുദ്ധമാണെന്ന് വിശ്വാസപ്രമാണത്തിൽ നാം പ്രഘോഷിക്കുന്നു. എന്നാൽ, സഭ പാപികളുടെ ഒരു കൂട്ടായ്മയാണെന്നും, എല്ലാ ദിവസവും ഞങ്ങൾ അവരുടെ പ്രവൃത്തികൾ  കാണുന്നതാണെന്നും നിങ്ങൾ പറഞ്ഞേക്കാം. സഭയിൽ പാപികൾ ഉണ്ടെണ്ടന്നത് സത്യമാണ്. ";
        textView.setText(text);
    }

首先,當我嘗試使用馬拉雅拉姆文本保存該文件時,收到以下消息:

我另存為UTF-8,然后繼續。 請注意,由於下載了文本,因此在我的實際應用中不會發生這種情況。

這是漂亮的基本xml

<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:padding="10dp"
 >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/textview1"
         />

</RelativeLayout>

這就是我得到的:

如您所見,文本視圖無法正確包裝文本(在末尾)。 僅在某些屏幕尺寸下會發生這種情況。 否則,很好。

英文文本不會發生這種情況。

我已經嘗試過單行,省略號,不同的填充等。

我覺得這與編碼有關,但與想法無關。

有人可以對此有所說明嗎?

好吧,這似乎是Android本身的錯誤: https : //code.google.com/p/android/issues/detail?id=38357

它似乎在4.2中已修復。 對於4.2之前的設備,我通過使用webview而不是textview解決了它。 Webview渲染不是完美的,但是比截斷文本更好。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM