Button就是一个View你应该是没有办法在View里面再加一个Button的建议你用ViewGroup
解决方案 »
- 菜鸟求助!android、在AlertDialog里面用自定义的BaseAdapter写了一个ListView。
- 由HashMap的遍历看android的优化
- onPreviewFrame 问题。
- 请教几个简单问题
- Android操作系统的智能手机能安装 集成开发环境 么?
- android系统字体的问题
- Android开发工作当中,最常用到的是哪些知识点?
- AIDL和接口的区别??他们有什么区别,感觉用起来差不多
- 基于jain的本地客户端访问SipServlet本地服务器
- android项目网络问题
- 请教 android程序中怎样判断列表中哪一行是被选中的
- Android设计界面主要会涉及到哪些技术?
楼上正解。楼主也可以自己判断点击的区域来实现button的效果。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText
android:id="@+id/entry"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"
android:layout_below="@id/label"/>
<Button
android:id="@+id/ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/entry"
android:layout_alignParentRight="true"
android:layout_marginLeft="10dip"
android:text="OK" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/ok"
android:layout_alignTop="@id/ok"
android:text="Cancel" />
</RelativeLayout>Button继承自View,但它不能直接被加在View中,但可以被加入ViewGruop;
这个RelativeLayout就是继承自ViewGroup,所以可以被加入!