手机免费建站平台下载,青海网页设计制作,上海网站开发运营,网络行业做什么挣钱本文实例讲述了Android编程实现简单设置按钮颜色的方法。分享给大家供大家参考#xff0c;具体如下#xff1a;1.工程目录a.在res目录-新建drawble文件夹放入自定义图片2.main.xmlandroid:orientationverticalandroid:layout_widthfill_parentandroi…本文实例讲述了Android编程实现简单设置按钮颜色的方法。分享给大家供大家参考具体如下1.工程目录a.在res目录-新建drawble文件夹放入自定义图片2.main.xmlandroid:orientationverticalandroid:layout_widthfill_parentandroid:layout_heightfill_parentandroid:layout_widthfill_parentandroid:layout_heightwrap_contentandroid:textstring/hello/android:idid/buttonandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:background#000000android:srcdrawable/sy/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;Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);Image(ImageButton)findViewById(R.id.button);}}希望本文所述对大家Android程序设计有所帮助。总结如果觉得编程之家网站内容还不错欢迎将编程之家网站推荐给程序员好友。本图文内容来源于网友网络收集整理提供作为学习参考使用版权属于原作者。小编个人微信号 jb51ccc喜欢与人分享编程技术与工作经验欢迎加入编程之家官方交流群