【发布时间】:2016-07-17 02:34:50
【问题描述】:
this is the picture with same text size on 5inch screen
this is the picture with same textsize on 4inch screen
我希望文本视图中的文本根据字体适合不同的屏幕尺寸。我使用 html 作为文本。
这是我的 strings.xml
<string name="seven">
<![CDATA[
<h1>श्रीज्ञानदेवाची आरती</h1>
<body>आरती ज्ञानराजा॥<br>
महाकैवल्यतेजा॥<br>
सेविती साधुसंत ॥<br>
मनु वेधला माझा ॥ ध्रु० ॥<br>
लोपलें ज्ञान जगीं ॥<br>
हित नेणती कोणी ॥<br>
अवतार पांडुरंग ॥<br>
नाम ठेविलें ज्ञानी ॥ आरती ॥ १ ॥<br>
कनकांचे ताट करीं ॥<br>
उभ्या गोपिका नारी ॥<br>
नारद तुंबरु ही ॥<br>
साम गायन करी ॥ आरती० ॥ २ ॥<br>
प्रगट गुह्य बोले ॥<br>
विश्व ब्रह्मची केलें ॥<br>
रामा जनार्दनीं ॥<br>
चरणी मस्तक ठेविले ॥ आरती० ॥ ३ ॥<br>
<br>
<br>
<br></body>]]>
activity.xml
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@+id/textView15"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
activity.java
tv15=(TextView)findViewById(R.id.textView15);
tv15.setTextSize((float)23.5);
tv15.setText(Html.fromHtml(getString(R.string.seven)));
【问题讨论】:
-
你遇到了什么问题?
-
文本在 5 英寸屏幕上正确显示.....而放在 4 英寸屏幕手机上时出现问题.....文本视图中的文本不适合它.. ..意味着有些行出现在下一行.....
-
查看图片 N J
-
检查这个stackoverflow.com/questions/9884091/…这可能对你有帮助