---
title: "Android中字体加粗"
author: "logger"
date: "2012-05-23T17:44:56Z"
tags: []
categories: ["移动开发"]
slug: "android"
draft: false
lastmod: "2012-05-29T17:28:07Z"
id: 1538853
url: "https://logger.iteye.com/blog/1538853"
---

Android中字体加粗

Android中字体加粗
一、在xml文件中使用android:textStyle=”bold”
二、但是不能将中文设置成粗体，将中文设置成粗体的方法是：
TextView tv = (TextView)findViewById(R.id.TextView01);
TextPaint tp = tv.getPaint();
tp.setFakeBoldText(true);



PS:
  android:duplicateParentState="true"

  继承父组件状态