freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

android_控件手冊(cè)(編輯修改稿)

2025-07-22 05:58 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 st toast = (, 你點(diǎn)擊了“+()+”按鈕!, )。 //設(shè)置toast顯示的位置 (, 0, 150)。 //顯示該Toast ()。 } })。 TextView 一個(gè)用來顯示文本的控件 xml設(shè)計(jì)TextView android:id= @+id/textView //設(shè)置id android:layout_width =fill_parent //寬度充滿全屏 android:layout_height=wrap_content //高度隨控件變化 android:layout_height=2dip android:textColor= android:background=aaa00 //背景顏色 android:text=你好/ android:paddingLeft=50px android:paddingTop=5px android:paddingBottom=5px android:textSize=30sp android:singleLine=true android:layout_below=@id/imageView_handler//在什么下 android:gravity =left //用于設(shè)置View中內(nèi)容相對(duì)于View組件的對(duì)齊方式, android:layout_gravity//用于設(shè)置View組件相對(duì)于Container的對(duì)齊方式。 android:paddingLeft=30px // 按鈕上設(shè)置的內(nèi)容離按鈕左邊邊界30個(gè)像素 android:layout_marginLeft=30px //整個(gè)按鈕離左邊設(shè)置的內(nèi)容30個(gè)像素 android:layout_weight=1//控件權(quán)重 即占的比例 默認(rèn)值為0 android:gravity=center_horizontal//水平居中 android:padding=3dip 代碼設(shè)計(jì)TextView textView = new TextView(this)。 //聲明對(duì)象 ()。 //設(shè)置字體顏色 (20)。 //設(shè)置字體大小 ()。//控件背景色 (你好) //顯示的文字 (GONE/VISIBLE)。 //設(shè)置為不可見/可見 ()。//設(shè)置文字權(quán)重 監(jiān)聽器TextView textView = new TextView(this)。 //得到對(duì)象 (new (){TextView監(jiān)聽器 public void onClick(View v){ } })。 ImageButton 帶圖標(biāo)的按鈕 xml設(shè)計(jì) ImageButton android:id= @+id/imageButton1 android:layout_width=wrap_content android:layout_height=wrap_content android:src=@drawable/qq //在xml設(shè)計(jì)所使用的圖片 / 代碼中設(shè)計(jì) (getResources().getDrawable())。//在代碼中設(shè)計(jì)使用的圖片(得到對(duì)象后) 監(jiān)聽器 (new () {ImageButton監(jiān)聽器 @Override public void onClick(View v) { //創(chuàng)建對(duì)話框 Dialog dialog = new () .setTitle(ImageButton2) .setMessage(跳轉(zhuǎn)到系統(tǒng)圖片) .setPositiveButton(確定, new () { @Override public void onClick(DialogInterface dialog, int which) { // TODO Autogenerated method stub (getResources().getDrawable())。 } }).create()。 ()。 } })。 EditText xml設(shè)計(jì) EditText android:id=@+id/editText android:layout_width=fill_parent android:layout_height=wrap_content android:textSize=18sp android:layout_x=29px android:layout_y=33px android:hint=請(qǐng)輸入賬號(hào) //設(shè)置當(dāng)m_EditText中為空時(shí)提示的內(nèi)容 / 代碼設(shè)計(jì)EditText editText = new EditText(this)。//得到EditText對(duì)象 (20)。 //設(shè)置字體大小 (請(qǐng)輸入賬號(hào))。 //設(shè)置當(dāng)m_EditText中為空時(shí)提示的內(nèi)容 監(jiān)聽器 (new (){EditText監(jiān)聽器 @Override public boolean onKey(View arg0, int arg1, KeyEvent arg2){ // 得到文字,將其顯示到TextView中 (文本框中內(nèi)容是: + ().toString())。 return false。 } })。 CheckBox 多項(xiàng)選擇 需要對(duì)沒有按鈕設(shè)置監(jiān)聽器 xml設(shè)計(jì) CheckBox android:id=@+id/checkBox android:layout_width=fill_parent android:layout_height=wrap_content android:text=@string/CheckBox4 監(jiān)聽器 (new () {//對(duì)每個(gè)選項(xiàng)設(shè)置事件監(jiān)聽CheckBox監(jiān)聽器 @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked){ if(()){ DisplayToast(你選擇了:+())。 } } })。 Spinner 下拉列表 下面一個(gè)例子將可選內(nèi)容通過ArrayAdapter和下拉列表連接起來。設(shè)置監(jiān)聽器 通過setVisibility方法設(shè)置當(dāng)前顯示項(xiàng) ?xml version= encoding=utf8? LinearLayout xmlns:android= android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/TextView1 android:layout_width=fill_parent android:layout_height=wrap_content android:text=@string/hello / Spinner android:id=@+id/Spinner1 android:layout_width=wrap_content android:layout_height=wrap_content android:layout_centerHorizontal=true / /LinearLayout public class Activity01 extends Activity{ private static final String[] string = { O型, A型, B型, AB型, 其他 }。 private TextView m_TextView。 private Spinner m_Spinner。 private ArrayAdapterString adapter。 @Override public void onCreate(Bundle savedInstanceState){ (savedInstanceState)。 setContentView()。 m_TextView = (TextView) findViewById()。 m_Spinner = (Spinner) findViewById()。 //將可選內(nèi)容與ArrayAdapter連接 adapter = new ArrayAdapterString(this, , string)。 //設(shè)置下拉列表的風(fēng)格 ()。 //將adapter添加到m_Spinner中 (adapter)。 //添加Spinner事件監(jiān)聽 (new () {Spinner監(jiān)聽器 @Override public void onItemSelected(AdapterView? arg0, View arg1, int arg2, long arg3){ (你的血型是: + string[arg2])。 //設(shè)置顯示當(dāng)前選擇的項(xiàng) ()。 } @Override public void onNothingSelected(AdapterView?
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1