Basically I have a RecyclerView
in my AlertDialog
(I've tried both the AppCompat one and the one from here) and when the list only has a few items the dialog is still as tall as it can be. Is there something I can do to fix this?
My layout is this:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></android.support.v7.widget.RecyclerView>
</LinearLayout>
and I'm adding it to the AlertDialog
like this:
LayoutInflater myLayout = LayoutInflater.from(context);
final View dialogView = myLayout.inflate(R.layout.list, null);
dialog.setView(myLayout);
How can I make it wrap_content
?