我想要将列表视图项目的字体更改为marathi,我使用字体更改TextField的字体,任何人都可以告诉我如何使用列表视图项目执行此操作。如何更改列表查看项目字体样式到MARATHI
0
A
回答
2
创建自定义的TextView类这样
public class CustomTextView extends TextView {
public CustomTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
public CustomTextView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public CustomTextView(Context context) {
super(context);
init();
}
@SuppressWarnings("null")
private void init() {
if (!isInEditMode()) {
// default style
Typeface tf = Typeface.createFromAsset(getContext().getAssets(),
"helveticaneue_bold.ttf");
setTypeface(tf);
}
}
将您的字体样式(Marathi.ttf文件,在这种情况下,我已经使用helveticaneue_bold.ttf)资产的文件夹。
你行,你已经膨胀到ListView控件在现在,而不是TextView的使用下面
<yourpackagename.CustomTextView
android:id="@+id/tv_title"
style="@style/buttontext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/company_profile" >
</yourpackagename.CustomTextView>
0
您必须实现CustomAdapter或BaseAdapter来实现这一目标。在getview方法膨胀其他xml文件,其中包含文本视图和settypeface它
相关问题
- 1. 更改列表查看项目选择样式
- 2. 更改所选列表项目的字体样式
- 3. 更改列表查看项目元素
- 4. 更改列表查看项目高度
- 5. 更改列表框项目样式
- 6. 如何更改微调项目的字体样式
- 7. 如何将列表视图项的字体设置为Marathi
- 8. 如何更改列表项目的自定义字体
- 9. 如何更改列表框中项目的字体颜色(wpf)
- 10. Devanagari/Marathi字体
- 11. 更改HTML表格的字体样式?
- 12. 更改字体样式
- 13. 更改字体样式
- 14. Angularjs更改字体样式
- 15. 支持marathi字体
- 16. 如何更改此列表的样式?
- 17. MultiColumn列表查看项目到文件
- 18. 列表查看项目(和子项目)
- 19. 通知列表查看项目中的更改
- 20. 如何在iOS中更改textview的字体系列和样式?
- 21. 如何更改.jumbotron h1字体系列中的样式
- 22. ActionBar action查看项目样式
- 23. 如何更改后备字体的字体大小和样式
- 24. JQuery:Click()更改列表项字体
- 25. 更改列表首选项的字体
- 26. 更改windows phone中的第一个列表框项目样式
- 27. 无法更改列表框中所选项目的样式
- 28. 更改复选框列表中所选项目的样式
- 29. 在运行时更改列表框项目样式
- 30. Android列表查看所选项目样式直到用户滚动才显示
这已经被回答了很多次...:http://stackoverflow.com/questions/12128331/how-to-change-fontfamily-of -textview-in-android http://stackoverflow.com/questions/2973270/using-a-custom-typeface-in-android http://stackoverflow.com/questions/3651086/android-using-custom-font http: //stackoverflow.com/questions/16901930/memory-leaks-with-custom-font-for-set-custom-font等等...... – Cehm