PopupDialog は DialogFragment this を拡張します。
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.lyt_dialog_popup, container, false);
_work();
return view;
}
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Dialog dialog = super.onCreateDialog(savedInstanceState);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
return dialog;
}
lyt_dialog_popup.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width ="match_parent"
android:layout_height="wrap_content">
<include
android:id="@+id/dialogPopupToolbar"
layout="@layout/toolbar"/>
<include
layout="@layout/rcy_list"
android:id="@+id/dialogPopupList"
android:layout_below="@id/dialogPopupToolbar"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_margin="5dp"/>
</RelativeLayout>
ツールバー.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="@color/primaryColor"/>
rcy_list.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
すべてのコードは正常に動作しますが、レイアウト wrap_content のみが正常に動作しません。どうすればこの問題を解決できますか?