Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何确定RecyclerView(带FlexboxLayoutManager)在AlertDialog中的位置_Android_Android Recyclerview_Flexbox_Padding - Fatal编程技术网

Android 如何确定RecyclerView(带FlexboxLayoutManager)在AlertDialog中的位置

Android 如何确定RecyclerView(带FlexboxLayoutManager)在AlertDialog中的位置,android,android-recyclerview,flexbox,padding,Android,Android Recyclerview,Flexbox,Padding,我在AlertDialog中有一个RecyclerView,下面是项目布局: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/relativeLayout" android

我在AlertDialog中有一个RecyclerView,下面是项目布局:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/relativeLayout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    xmlns:tools="http://schemas.android.com/tools">
<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingRight="10dp"
        android:paddingLeft="10dp"
        android:gravity="center"
        android:textSize="14sp"
        tools:text="医药"
        android:id="@+id/subcate"
        android:textColor="#60000000"
        android:paddingBottom="10dp"
        android:paddingTop="10dp" />
  </RelativeLayout>

以下是RecyclerView的根布局:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/dialog_main_layout"
    android:layout_width="500dp"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:background="#f6f6f6" >

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recycler"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</androidx.constraintlayout.widget.ConstraintLayout>


我的问题是:填充是如何添加的,dp是多少?

请共享
样式
文件