Bu yüzden bir ImageView arka plan olarak ve bunun üzerine bir Yatay RecyclerView var, buradaki şey, RecyclerView öğesinin ekranın solundaki dolgudan öğelerini göstermeye başlamasını istiyorum. En baştaki arka planı mükemmel bir şekilde görebilir ve görüntüyü/arkaplanı sakladığınız öğeleri kaydettiğinizde.Yatay doldurma başlatıcısı ile başlangıç yastığı
Not: Ne yapmaya çalıştığımı görmek için Play Store'u kontrol edin.
Bu yüzden bu çalışma vardı:<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#000052"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="200dp"
android:scaleType="centerCrop"
android:src="@drawable/trybg5"
android:layout_gravity="left" />
<HorizontalScrollView
android:id="@+id/frag_home_gallery_recent_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="right"
android:scrollbars="none"
android:layout_weight="1"
android:paddingBottom="@dimen/horizontalGallery_content_padding"
android:paddingTop="@dimen/horizontalGallery_content_padding">
<LinearLayout
android:id="@+id/frag_home_gallery_recientes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="150dp" />
</HorizontalScrollView>
</RelativeLayout>
Benim noktası programlı HorizontalScrollView iç düzenini şişirmek için oradaydı ve o güzel çalıştı. Ama zamanla, RecyclerView'a geçmeye karar verdim ve şimdi beklendiği gibi çalışmıyor.
arka plan görünür, Recycler sağa yarım ekran başlar, ancak ekranın sol kadar kaydırma olmaz kaydırma zaman, dolgu kuruldu yerde gizlemek sadece edecek ..
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#000052"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="200dp"
android:scaleType="centerCrop"
android:src="@drawable/trybg5"
android:layout_gravity="left" />
<FrameLayout
android:id="@+id/frag_home_gallery_recent_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="right"
android:scrollbars="none"
android:layout_weight="1"
android:paddingBottom="@dimen/horizontalGallery_content_padding"
android:paddingTop="@dimen/horizontalGallery_content_padding">
<android.support.v7.widget.RecyclerView
android:background="@drawable/gallery_bg"
android:id="@+id/frag_home_gallery_recientes"
android:scrollbars="none"
android:paddingLeft="150dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</FrameLayout>
</RelativeLayout>
Bu efekti nasıl oluşturabilirim konusunda herhangi bir fikir RecyclerView'da çalışır?
İşte çöp ait ayrıntı verilmiştir:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:id="@+id/discoContainer"
android:background="@drawable/gallery_bg"
android:layout_margin="5dp"
android:padding="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/containerDisco"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/logoDisco"
android:transitionName="DiscoId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:contentDescription="LogoDisco"
android:windowSharedElementsUseOverlay="false" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="a 600m tuyos"
android:padding="3dp"
android:layout_gravity="center_horizontal"
android:maxLines="1"
android:gravity="center_horizontal"
android:alpha="500"
android:background="#46000000"
android:textColor="@android:color/white"/>
</RelativeLayout>
<TextView
android:id="@+id/logoTexto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Probando"
android:padding="3dp"
android:layout_gravity="center_horizontal"
android:maxLines="1"
android:gravity="center_horizontal"
android:layout_alignBottom="@+id/containerDisco" />
</LinearLayout>
</LinearLayout>
: Yani örneğin
. Çok teşekkür ederim! Bunu bir Android problemi olarak düşünmedim, ancak bir css problemine daha çok benzemeye başladım :) –
İşte RTL desteği ile Kotlin için genişletilmiş bir sürüm: https://gist.github.com/sevar83/1172423f265e1cbb7a04f3d22b12021a – WindRider
hi @ GuillermoLópez Sol tarafta bir düğmem var, aynı davranışı istiyorum. Bunu nasıl başarabiliriz? – Sac