Skip to content Skip to sidebar Skip to footer

How To Allow Scrolling In Android's PopupWindow

I have a PopupWindow that is populated with a LinearLayout. I instatiated my popup window like this: PopupWindow pw = new PopupWindow(layout, 450, 700, true); pw.showAsDropDown(la

Solution 1:

LinearLayouts aren't scrollable, so instead enclose the LinearLayout in a ScrollView.


Solution 2:

I do it using this and worked:

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

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="#444444">

</RelativeLayout>
</ScrollView>
</LinearLayout>

I hope it can be useful for you. Bye


Post a Comment for "How To Allow Scrolling In Android's PopupWindow"