亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Android用戶(hù)界面開(kāi)發(fā)之:TextView的使用實(shí)例

 更新時(shí)間:2013年05月20日 10:29:08   作者:  
Android用戶(hù)界面開(kāi)發(fā)之:TextView的使用實(shí)例,需要的朋友可以參考一下

TextView就是一個(gè)用來(lái)顯示文本標(biāo)簽的控件。

復(fù)制代碼 代碼如下:

/*TextView的設(shè)置*//* 獲得TextView對(duì)象 */      
textview = (TextView)this.findViewById(R.id.textview);      
String string = "TextView示例!";    
/* 設(shè)置文本的顏色 */  
textview.setTextColor(Color.RED);       
/* 設(shè)置字體大小 */       
textview.setTextSize(20);       
/* 設(shè)置文字背景 */       
textview.setBackgroundColor(Color.BLUE);       
/* 設(shè)置TextView顯示的文字 */       
textview.setText(string);

復(fù)制代碼 代碼如下:

/*TextView顯示網(wǎng)頁(yè)*/textView1 = (TextView) this.findViewById(R.id.textview1);
textView2 = (TextView) this.findViewById(R.id.textview2);
// 添加一段html的標(biāo)志
String html = "<font color='red'>I love android</font><br>";
html += "<font color='#0000ff'><big><i>I love android</i></big></font><p>";
html += "<big><a href='http://chabaoo.cn'>腳本之家</a></big>";
CharSequence charSequence = Html.fromHtml(html);
textView1.setText(charSequence);
textView1.setMovementMethod(LinkMovementMethod.getInstance());// 點(diǎn)擊的時(shí)候產(chǎn)生超鏈接   
String text = "我的URL:http://chabaoo.cn\n";
text += "我的email:****** @gmail.com\n";
text += "我的電話(huà):+ 86 137********";
textView2.setText(text);
textView2.setMovementMethod(LinkMovementMethod.getInstance());

相關(guān)文章

最新評(píng)論