آموزش های این وب سایت به صورت رایگان در دسترس است. اطلاعات بیشتر
بروز خطا
   [message]
اشتراک در سوال
رای ها
[dataList]

درج آیتم ها در وسط ریسایکلریو

رضا  8 سال پیش  8 سال پیش
0 0

سلام . من ی  ریسایکلر ویو دارم . که لیوت منیجرش لینیر عمودی هستش و 5 تا آیتم بیشتر نداره . میخوام ریسایکر ویو ارتفاعش کل لیوت رو بگیره ولی آیتم هام وسط صفحه باشن. ممنون میشم راهنمایی کن

 
mRecyclerView = findViewById(R.id.recyclerView);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getApplicationContext(), LinearLayoutManager.VERTICAL, false);
mRecyclerView.setLayoutManager(linearLayoutManager);
setData();
DataRecyclerViewAdapter dataRecyclerViewAdapter = new DataRecyclerViewAdapter(getApplicationContext(), dataModelArrayList, this);
ItemTouchHelper.Callback callback =
new RecyclerViewItemTouchHelperCallback(dataRecyclerViewAdapter);
mItemTouchHelper = new ItemTouchHelper(callback);
mItemTouchHelper.attachToRecyclerView(mRecyclerView);
dataRecyclerViewAdapter.delegate = this;
mRecyclerView.setAdapter(dataRecyclerViewAdapter);
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearlayot"
android:layout_width="150dp"
android:layout_height="64dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/arrow"
android:gravity="center"
android:orientation="vertical">


<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingLeft="10dp"
android:textSize="20dp" />


</LinearLayout>

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.rayansoft.game.game_1.MainActivity">



<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_weight="1"
android:addStatesFromChildren="false"
android:clipChildren="false"
android:clipToPadding="false"
android:layoutDirection="ltr"
android:padding="10dp"
android:soundEffectsEnabled="false"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />




</android.support.constraint.ConstraintLayout>
 برای این سوال پاسخی وجود ندارد.

پاسخگویی و مشاهده پاسخ های این سوال تنها برای اعضای ویژه سایت امکان پذیر است .
چنانچه تمایل دارید به همه بخش ها دسترسی داشته باشید میتوانید از این بخش لایسنس این آموزش را خریداری نمایید .