Android 使文本粗体和斜体
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12183860/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Make text bold and italic
提问by Jeremy Quick
Is there anyway to make Android text in the xml file both bold and italics?
有没有办法让 xml 文件中的 Android 文本既粗体又斜体?
SAMPLE
样本
回答by Kevin Coppock
Yes, just add android:textStyle="bold|italic"
.
是的,只需添加android:textStyle="bold|italic"
.
回答by MAC
have you tried this
你试过这个吗
android:textStyle="italic|bold"
回答by ρяσ?ρ?я K
try this:
尝试这个:
<Textview android:textStyle="bolditalic" ....
for more info see http://developer.android.com/reference/android/widget/TextView.html#attr_android:textStyle
有关更多信息,请参阅http://developer.android.com/reference/android/widget/TextView.html#attr_android:textStyle
回答by Swayam
<TextView
android:id="@+id/mTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold|italic"
android:text="YOUR_TEXT"
/>