Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/212.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 我的imageButton一直与我想要在屏幕底部显示的textview重叠_Android - Fatal编程技术网

Android 我的imageButton一直与我想要在屏幕底部显示的textview重叠

Android 我的imageButton一直与我想要在屏幕底部显示的textview重叠,android,Android,由于某些原因,我的图像按钮一直重叠。当我使用顶部的滚动视图时,它工作正常,一切正常,但我不想向下滚动查看我点击了多少次。我只希望文本视图位于屏幕底部,而不希望图像按钮与它重叠 我做错了什么? 这是我在尝试新事物 <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_

由于某些原因,我的图像按钮一直重叠。当我使用顶部的滚动视图时,它工作正常,一切正常,但我不想向下滚动查看我点击了多少次。我只希望文本视图位于屏幕底部,而不希望图像按钮与它重叠

我做错了什么? 这是我在尝试新事物

    <?xml version="1.0" encoding="utf-8"?>


    <LinearLayout
      android:id="@+id/LinearLayout01"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical">

    <!-- Stretching frame layout using weights will bring it to the bottom -->


    <TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/pushme"
    android:textSize="21sp"
    android:gravity="center_horizontal|center_vertical"
    android:textColor="#ff0005"
    android:background="#ff99ff"

    />



    <Button
    android:id="@+id/button"
    android:scaleType="fitCenter"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/push"


    />


<FrameLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="0dip"
    android:layout_gravity="bottom"
    android:layout_weight="1" 
    android:layout_below="@+id/numClicked"
    >

    <TextView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:padding="8dip"
         android:text="@string/numClicked"
         android:background="#ffffffff"
         android:textColor="#ff127223"

         />

    </FrameLayout>



    </LinearLayout>

现在这是我使用滚动视图工作,但我不想要滚动视图

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

    <!-- Stretching frame layout using weights will bring it to the bottom -->


    <TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/pushme"
    android:textSize="21sp"
    android:gravity="center_horizontal|center_vertical"
    android:textColor="#ff0005"
    android:background="#ff99ff"

    />



    <Button
     android:id="@+id/button"
     android:scaleType="fitCenter"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:background="@drawable/push"


 />


<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="0dip"
    android:layout_gravity="bottom"
    android:layout_weight="1" 

    >

    <TextView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:padding="8dip"
         android:text="@string/numClicked"
         android:background="#ffffffff"
         android:textColor="#ff127223"

         />


试试这个,我必须改变一些东西才能在我的模拟器上看到它,但是你可以了解它的要点

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

<LinearLayout android:layout_width="fill_parent"
    android:orientation="vertical" android:layout_above="@+id/numClicked"
    android:layout_height="fill_parent">

    <TextView android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:text="pushme"
        android:textSize="21sp" android:gravity="center_horizontal|center_vertical"
        android:textColor="#ff0005" android:background="#ff99ff" />

    <ImageButton android:src="@drawable/push"
        android:layout_width="fill_parent" android:id="@+id/button"
        android:layout_height="wrap_content" android:layout_gravity="center" />

</LinearLayout>

<TextView android:layout_width="fill_parent" android:id="@+id/numClicked"
    android:layout_height="wrap_content" android:padding="8dip"
    android:text="numClicked" android:layout_alignParentBottom="true" />

</RelativeLayout>

//我不明白你的问题是什么

你能试一下吗?这会解决你的问题

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

        <!-- Stretching frame layout using weights will bring it to the bottom -->

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="#ff99ff"
            android:gravity="center_horizontal|center_vertical"
            android:text="pushme"
            android:textColor="#ff0005"
            android:textSize="21sp" />

        <ImageView
            android:id="@+id/button"
                android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:src="@drawable/apps_icon"
            android:layout_weight="1"
            android:scaleType="center" />

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="#ffffffff"
                android:padding="8dip"
                android:text="numClicked"
                android:textColor="#ff127223" />
        </LinearLayout>
    </LinearLayout>

如果我做对了??你的按钮在那里。。你正在设置背景图像。。如果是的话!!然后在布局中添加下面的按钮标记以代替按钮标记。。祝你一切顺利

<Button
android:id="@+id/button"
android:scaleType="fitCenter"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:layout_marginBottom="10dp"
android:background="@drawable/push"


/>


这些布局不完整。它没有显示你在说什么。使其正确,否则无法解决它。图像按钮在布局中的位置。哥们,我在那里看不到任何图像按钮标签..酷,请单击“接受回答”按钮,这样其他人就不会继续回答它了。它在我的xml文件的图形布局中工作,而不是在电话上。你使用了我的代码并对其进行了修改,还是使用了你的代码并对其进行了修改?是的,当我更改它时,它确实起了作用,谢谢事实上我刚运行过,现在我有一个力接近了?