Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 我在声明按钮,在按钮上我声明图像,按钮点击不起作用_Android_Button_Imageview - Fatal编程技术网

Android 我在声明按钮,在按钮上我声明图像,按钮点击不起作用

Android 我在声明按钮,在按钮上我声明图像,按钮点击不起作用,android,button,imageview,Android,Button,Imageview,//我在声明按钮,在按钮上我在声明图像,当我向下拖动图像时,按钮单击不起作用,按钮不旋转。如何在同一位置声明按钮和图像 <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/LLayout" android:layout_width="fill_parent"

//我在声明按钮,在按钮上我在声明图像,当我向下拖动图像时,按钮单击不起作用,按钮不旋转。如何在同一位置声明按钮和图像

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/LLayout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dip"
        android:text="Button" />

    <AbsoluteLayout
        android:id="@+id/alTop"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" >

        <ImageView
            android:id="@+id/ivImage"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:scaleType="matrix"
            android:src="@drawable/dd" />
    </AbsoluteLayout>

</FrameLayout>

试试这个,可能会有帮助

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >

<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dip"
    android:background="@drawable/dd"
    android:text="Button" />


不要使用绝对布局…它已被弃用………没有办法使用它是的,我删除了绝对布局,但没有用,但我想声明android:marigintop=0dip用于按钮,android:marigintop=0dip用于图像。