偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

Android API中文文檔Button

移動開發(fā) Android
Android API中文文檔Button是本文要介紹的內(nèi)容,主要是來了解并學習Android API文檔的內(nèi)容,具體Android API文檔內(nèi)容的詳解來看本文。

Android API中文文檔Button是本文要介紹的內(nèi)容,主要是來了解并學習Android API文檔的內(nèi)容,具體Android API文檔內(nèi)容的詳解來看本文。

一、Android API結(jié)構(gòu)

  1. public class Button extends TextView  
  2. java.lang.Object  
  3. android.view.View  
  4. android.widget.TextView  
  5. android.widget.Button 

已知直接子類

  1. CompoundButton 

已知間接子類

  1. CheckBox  
  2. RadioButton  
  3. ToggleButton 

二、Android API概述

Android API中代表一個按鈕部件。用戶通過按下按鈕,或者點擊按鈕來執(zhí)行一個動作。以下是一個按鈕在activity中典型的應用:

然后,你能在xml布局中通過button的android:onClick屬性指定一個方法,以替代在activity中為button設置OnClickListener。例如:

現(xiàn)在,當用戶點擊按鈕時,Android系統(tǒng)調(diào)用activity的selfDestruct(View)方法。為了正確執(zhí)行,這個方法必須是public并且僅接受一個View類型的參數(shù)。例如:

三、Android API按鈕樣式

每個按鈕的樣式默認為系統(tǒng)按鈕的背景,不同的設備、不同的平臺版本有不同按鈕風格。如你不滿意默認的按鈕樣式,想對其定制以符合您應用程序的設計,那么你能用state list drawable替換按鈕的背景圖片。一個狀態(tài)列表drawable是一個在XML中定義的drawable資源,根據(jù)當前按鈕的狀態(tài)改變其圖片。一旦你在XML中定義了一個狀態(tài)列表drawable,你可以將它應用于你的android:background屬性。欲了解更多信息和示例,參見State List Drawable.

實現(xiàn)一個按鈕的例子可參見Form Stuff tutorial。

小結(jié):Android API中文文檔Button的內(nèi)容介紹完了,希望通過Android API內(nèi)容的學習能對你有所幫助!

責任編輯:zhaolei 來源: 博客園
相關推薦

2011-09-14 13:56:28

Android API

2011-09-14 13:09:06

Android API

2011-09-14 13:35:55

Android API

2011-09-14 11:31:26

Android API

2011-09-14 13:18:59

Android API

2011-09-14 13:24:48

Android API

2011-12-22 12:37:17

JavaJFreeChart

2012-03-07 10:54:26

appMobi開發(fā)工具PhoneGap

2021-10-03 15:15:30

Vue.JSGitee Pages中文文檔

2011-09-07 13:30:48

Android WidTabWidget

2022-08-08 12:54:32

中文文本糾錯糾錯錯別字

2011-03-17 08:58:09

數(shù)據(jù)儲存Data StoragAndroid API

2015-01-26 14:35:44

Cocos 2d-JS

2024-09-10 08:15:33

Asp項目API

2013-07-24 18:14:36

Android開發(fā)學習Android UIButton

2010-01-26 10:02:51

Android But

2014-09-24 11:42:46

AndroidButton

2011-03-18 09:26:16

iptablesman文檔中文

2011-03-18 10:16:12

iptablesman文檔中文

2011-05-30 14:54:46

Android 單擊事件
點贊
收藏

51CTO技術(shù)棧公眾號