开发者

android view items are not fixed on the screen

开发者 https://www.devze.com 2023-04-02 03:19 出处:网络
I have the following xml file for my android project. My problem is that the button placed under the list changes its location depanding on the list data.

I have the following xml file for my android project.

My problem is that the button placed under the list changes its location depanding on the list data.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="match_parent"
  android:layout_height="match_parent" android:weightSum="1">
    <EditText android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/EditTextId"/>
    <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:id="@+id/Id2" android:text="@string/ButtonStr"></Button>
    &l开发者_StackOverflow中文版t;ListView android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@android:id/android:list"></ListView>
    <FrameLayout android:id="@+id/frameLayout1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="0.84"></FrameLayout>
    <ImageView android:id="@+id/Id1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/button"></ImageView>

</LinearLayout>


I suggest if you dont want your button to shift places add a scrollview around your list http://developer.android.com/reference/android/widget/ScrollView.html

0

精彩评论

暂无评论...
验证码 换一张
取 消