最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android編程實(shí)現(xiàn)簡單設(shè)置按鈕顏色的方法

 更新時間:2017年03月02日 09:42:59   作者:羅瑜  
這篇文章主要介紹了Android編程實(shí)現(xiàn)簡單設(shè)置按鈕顏色的方法,涉及Android控件布局與屬性設(shè)置相關(guān)操作技巧,需要的朋友可以參考下

本文實(shí)例講述了Android編程實(shí)現(xiàn)簡單設(shè)置按鈕顏色的方法。分享給大家供大家參考,具體如下:

1.工程目錄

a.在res目錄-新建drawble文件夾放入自定義圖片

2.main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:Android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  >
<TextView
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="@string/hello"
  />
  <ImageButton
  android:id="@+id/button"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:background="#000000"
  android:src="@drawable/sy"
  />
</LinearLayout>

3.類代碼

package com.YANSE;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageButton;
public class YANSE extends Activity {
  private ImageButton Image =null;
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    Image=(ImageButton)findViewById(R.id.button);
  }
}

更多關(guān)于Android相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《Android布局layout技巧總結(jié)》、《Android視圖View技巧總結(jié)》、《Android開發(fā)入門與進(jìn)階教程》、《Android調(diào)試技巧與常見問題解決方法匯總》、《Android多媒體操作技巧匯總(音頻,視頻,錄音等)》、《Android基本組件用法總結(jié)》及《Android控件用法總結(jié)

希望本文所述對大家Android程序設(shè)計有所幫助。

相關(guān)文章

最新評論

革吉县| 同仁县| 林芝县| 峨边| 天峻县| 营口市| 新巴尔虎左旗| 漳平市| 长顺县| 连云港市| 五大连池市| 黄冈市| 宕昌县| 漳浦县| 邻水| 景宁| 石首市| 怀安县| 沂源县| 勐海县| 温宿县| 陆丰市| 双流县| 麻江县| 察隅县| 元朗区| 胶南市| 重庆市| 金平| 沙雅县| 三原县| 和平区| 万山特区| 白水县| 阳春市| 建水县| 怀来县| 尤溪县| 陇西县| 宁夏| 乌审旗|