Open qianshengta opened 4 years ago
加粗:getPaint().setFakeBoldText(true);也可以参考demo里的ScaleTransitionPagerTitleView。
getPaint()是讲全部的文字设置了粗体 而我的需求是将选中的文字设为粗体,所以我觉得第一个方法行不通,我再看看第二种方法
@Override
public void onSelected(int index, int totalCount) {
setTextColor(mSelectedColor);
getPaint().setFakeBoldText(true);
}
@Override
public void onDeselected(int index, int totalCount) {
setTextColor(mNormalColor);
getPaint().setFakeBoldText(false);
}
如何设置选中的文字变粗体?现在我只发现可以改变颜色的方法,好像无法改变文字大小和字体,比如说变成粗体之类的