Android 上标顶部被裁剪
我尝试并寻找解决此问题的方法但无济于事。字母的顶部,例如小写“d”的尾部被剪掉。这是我目前拥有的:
Codewise:
来自 onClickHandler.....
String selectedorder = ""; ... if (num_players == 3) { editor.putString("prefPrefp3_name", child.getText().toString()); selectedorder = "第三rd";} ... order.setText(Html.fromHtml(selectedorder));
从 CursorAdapter BindView ............
TextView tv4 = (TextView) view.findViewById(R.id.dspplyrorder);
tv4.setText(Html.fromHtml(playersCursor.getString(PlayerOrder)));
以及从 XML,我试图让 @+id/dspplyrorder 不剪辑我的“d”的尾部上标......................
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/dsp_id"
android:layout_width="120dip"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/dspplyrname"
android:layout_width="180dip"
android:textColor="#7CFC00"
android:textStyle="italic"
android:layout_marginRight="20dip"
android:layout_marginLeft="20dip"
android:paddingRight="3dp"
android:gravity="left"
android:textSize="25sp"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/dspplyrorder"
android:layout_width="30dip"
android:gravity="left"
android:textColor="#FFFFFF"
android:textSize="16sp"
android:layout_height="wrap_content"/>
<ToggleButton android:id="@+id/button_toggle"
android:text="@string/buttons_1_toggle"
android:textOff="Select"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:onClick="myClickHandler" />
</LinearLayout>
我并不担心影响上方或下方行的行距,这似乎是最常出现的问题讨论。我一定是在做一些非常垃圾的事情,因为似乎没有人有这个问题。请帮忙。
I tried and searched for a solution to this problem to no avail. The top of letters, such as the tail in a lower-case "d" are being clipped off. Here's is what I currently have:
Codewise:
From the onClickHandler.....
String selectedorder = "";
...
if (num_players == 3) {
editor.putString("prefPrefp3_name", child.getText().toString());
selectedorder = "3rd";}
...
order.setText(Html.fromHtml(selectedorder));
From the CursorAdapter BindView.................
TextView tv4 = (TextView) view.findViewById(R.id.dspplyrorder);
tv4.setText(Html.fromHtml(playersCursor.getString(PlayerOrder)));
And from the XML, where I'm trying to get @+id/dspplyrorder to NOT CLIP the tail of the "d" in my superscript...................
<LinearLayout android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/dsp_id"
android:layout_width="120dip"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/dspplyrname"
android:layout_width="180dip"
android:textColor="#7CFC00"
android:textStyle="italic"
android:layout_marginRight="20dip"
android:layout_marginLeft="20dip"
android:paddingRight="3dp"
android:gravity="left"
android:textSize="25sp"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/dspplyrorder"
android:layout_width="30dip"
android:gravity="left"
android:textColor="#FFFFFF"
android:textSize="16sp"
android:layout_height="wrap_content"/>
<ToggleButton android:id="@+id/button_toggle"
android:text="@string/buttons_1_toggle"
android:textOff="Select"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:onClick="myClickHandler" />
</LinearLayout>
I am not worried about affecting the line spacing of lines above or below, which seems to be the most often occurring problem discussion. I must be doing something really dump, since no one else seems to have this problem. HELP Please.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个解决方案对我有用。
当浏览器渲染时,上标文本通常会变小,这似乎不会发生在这里,因此您可以通过执行以下操作来复制它(并解决此问题):
This solution worked for me.
Superscripted text is usually made smaller when the browser renders it, that doesn't seem to happen here so you can replicate that (and solve this problem) by doing this:
为您的 TextView 设置以下内容:
应该可以了。干杯!
Set the following for your TextView:
That should do it. Cheers!