ImageButton应用
来源:互联网 发布:程序员的压力大 编辑:程序博客网 时间:2024/06/15 00:08
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:src="@drawable/selector" android:layout_height="wrap_content" android:id="@+id/imageButton1" android:layout_width="wrap_content"></ImageButton>
<!-- android:src为图片地址 -->
</LinearLayout>
drawable目录下新建selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/arrow_pressed" />
<!-- 按钮按下效果 arrow_pressed和arrow_normal 为图片文件名称 -->
<item android:state_focused="true"
android:drawable="@drawable/arrow_pressed" />
<!-- 按钮获取焦点效果 -->
<item android:drawable="@drawable/arrow_normal" />
<!-- 按钮默认效果 -->
</selector>
<?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:src="@drawable/selector" android:layout_height="wrap_content" android:id="@+id/imageButton1" android:layout_width="wrap_content"></ImageButton>
<!-- android:src为图片地址 -->
</LinearLayout>
drawable目录下新建selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/arrow_pressed" />
<!-- 按钮按下效果 arrow_pressed和arrow_normal 为图片文件名称 -->
<item android:state_focused="true"
android:drawable="@drawable/arrow_pressed" />
<!-- 按钮获取焦点效果 -->
<item android:drawable="@drawable/arrow_normal" />
<!-- 按钮默认效果 -->
</selector>
- ImageButton应用
- ImageButton组件的应用
- ImageButton
- ImageButton
- ImageButton
- imagebutton
- ImageButton
- ImageButton
- ImageButton
- 杂乱之android的ImageButton应用
- ImageButton组件的应用(更改头像)
- Button,ImageButton,EditText三控件的应用。
- 在ImageButton上应用onmouseover和onmouseout事件
- 在ImageButton上应用onmouseover和onmouseout事件
- Android 应用开发笔记 - 按钮(Button, ImageButton)
- android应用开发揭秘examples_04-16笔记(ImageButton的使用)
- Android中使用selector动态改变imageView或ImageButton的背景和在GridView中应用
- Android开发学习笔记(六)Android应用界面编程 Button/ImageButton学习
- Android学习笔记之mainfest文件中android属性
- Linux(Debian)问题与解决方案(更新中)
- 笔试2
- Internet Explorer 编程简述(二)在IE中编辑OLE嵌入文档
- Oracle 面试题集锦-技术篇
- ImageButton应用
- linux(debian)学习资源
- 笔试3
- JS控制通过Select选择Gridview
- 关于#pragma warning 及warning4786
- Internet Explorer 编程简述(三)“整理收藏夹”对话框
- css横版布局的技巧
- 软件系统性能设计之一总述
- 笔试4