में नीचे के दृश्य गायब हो जाता है मेरे पास एक संवाद है जिसमें एक ScrollView
के अंदर एक सूची है (TextView
एस LinearLayout
के अंदर)। लेआउट इस प्रकार है:स्क्रॉलव्यू एक संवाद
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ProgressBar
android:id="@+id/delete_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
<ScrollView
android:id="@+id/filename_scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/filename_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
<View
android:id="@+id/horisontal_separator"
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray" />
<LinearLayout
android:id="@+id/button_container"
android:layout_width="match_parent"
android:layout_height="48dp" >
<Button
android:id="@+id/load_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/button_load"
android:gravity="center"
android:layout_weight="1" />
<View
android:layout_width="1dp"
android:layout_height="fill_parent"
android:background="@android:color/darker_gray" />
<Button
android:id="@+id/delete_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/button_delete"
android:gravity="center"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
यह केवल सूची पर कुछ वस्तुओं के साथ इस तरह दिखता है:
लेकिन जब एक से अधिक स्क्रीन पर फिट कर सकते हैं (और स्क्रॉल करने के लिए वास्तविक जरूरत नहीं है) , मेरे बटन स्क्रीन के नीचे धक्का मिलता है। नीचे तक स्क्रॉल करते हैं, यह इस तरह दिखता है:
मैं LinearLayout
बटन युक्त पाद लेख के रूप में रहने के लिए, यह कहीं भी स्क्रॉल नहीं करना चाहिए और स्पष्ट रूप से गायब नहीं की जरूरत है। मैंने लेआउट ऊंचाई और वजन के साथ झुकाव करने की कोशिश की है, लेकिन इसका कोई फायदा नहीं हुआ है।
क्या आपने ListView को निश्चित ऊंचाई पर सेट करने का प्रयास किया है उदाहरण के लिए 200 डीआईपी? – Demonick
मेरे पास वास्तविक 'ListView' नहीं है, लेकिन 'LinearLayout' की ऊंचाई को बदलने से कोई फर्क नहीं पड़ता है। और यदि मैं 'स्क्रॉलव्यू' की ऊंचाई बदलता हूं, तो यह बटन को फिर से धक्का देता है। – j0ntech