android:为TextView添加样式——下划线,颜色,设置链接样式及前背景色
2012-11-27 16:10
696 查看
public class AtActivity extends Activity {
LinearLayout ll;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ll=(LinearLayout)findViewById(R.id.ll);
TextView tv=new TextView(this);
tv.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);//下划线
tv.setText("使用代码实现下划线样式");
tv.setTextColor(Color.WHITE);
ll.addView(tv);
tv=new TextView(this);
tv.setText(Html.fromHtml("<u>使用html实现下划线样式</u>"));
ll.addView(tv);
}
}
LinearLayout ll;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ll=(LinearLayout)findViewById(R.id.ll);
TextView tv=new TextView(this);
tv.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);//下划线
tv.setText("使用代码实现下划线样式");
tv.setTextColor(Color.WHITE);
ll.addView(tv);
tv=new TextView(this);
tv.setText(Html.fromHtml("<u>使用html实现下划线样式</u>"));
ll.addView(tv);
}
}
相关文章推荐
- android:为TextView添加样式——下划线,颜色,设置链接样式及前背景色
- android:为TextView添加样式——下划线,颜色,设置链接样式及前背景色
- android:为TextView添加样式——下划线,颜色,设置链接样式及前背景色
- android:为TextView添加样式——下划线,颜色,设置链接样式及前背景色
- android:为TextView添加样式——下划线,颜色,设置链接样式及前背景色
- android:为TextView添加样式——下划线,颜色,设置链接样式及前背景色
- android:为TextView添加样式——下划线,颜色,设置链接样式及前背景色
- 为TextView添加样式——下划线,颜色,设置链接样式及前背景色
- android:为TextView加入样式——下划线,颜色,设置链接样式及前背景色
- Android中TextView通过SpannableString设置字体、大小、颜色、样式、超级链接
- SpannableStringBuilder设置TextView文字格式(颜色、背景色、下划线、删除线等)
- android:TextView中的文本链接之--设置超链接、颜色、字体等属性
- android:TextView中的文本链接之--设置超链接、颜色、字体等属性
- android textview 中部分内容 颜色 样式 点击事件的设置9
- Android 在TextView中设置不同的字体、颜色、链接等
- Android TextView设置高亮,颜色,点击跳转链接
- AndroidのTextView背景色、圆角、内部填充设置样式
- 设置TextView中超链接字体颜色、下划线
- android:TextView设置背景色和文本颜色
- Android Html设置TextView的颜色、加粗样式