我是靠谱客的博主 畅快外套,这篇文章主要介绍Android文字头部被切掉,Android textview文本在自定义字体的两侧被切断,现在分享给大家,希望可以做个参考。

这是在预览和设备上发生的事情:

7ffb28c778bf0e9cf2c7769e526b8fb2.png

TextView没什么特别的,只是加载自定义字体:

public class TestTextView extends AppCompatTextView {

public TestTextView(Context context) {

super(context);

init(context);

}

public TestTextView(Context context, AttributeSet attrs) {

super(context, attrs);

init(context);

}

public TestTextView(Context context, AttributeSet attrs, int defStyle) {

super(context, attrs, defStyle);

init(context);

}

void init(Context context) {

Typeface t = Typeface.createFromAsset(context.getAssets(), "fonts/daisy.ttf");

setTypeface(t);

}

}

布局也很基础,但以防万一:

xml

最后

以上就是畅快外套最近收集整理的关于Android文字头部被切掉,Android textview文本在自定义字体的两侧被切断的全部内容,更多相关Android文字头部被切掉,Android内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(46)

评论列表共有 0 条评论

立即
投稿
返回
顶部