[英]How we can set or change the background of Swipe layout or Recycle view like Whatsapp chat
I want to create same UI as whatsapp chat.Here you can see whatsapp has background image:我想创建与 whatsapp 聊天相同的 UI。在这里你可以看到 whatsapp 有背景图片:
Now this is my app in which I have a relative layout that contains swipe layout ( androidx.swiperefreshlayout
) in which it has recycle view.现在这是我的应用程序,其中我有一个包含滑动布局(
androidx.swiperefreshlayout
)的相对布局,其中它具有回收视图。 This is my app with normal color background:这是我的具有正常颜色背景的应用程序:
I just want to set an image in the background same as WhatsApp.我只想在背景中设置与 WhatsApp 相同的图像。 In order to achieve this what should I do?
为了实现这一点,我应该怎么做?
Why don't you put it in the XML like this?你为什么不把它放在XML这样呢?
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/lst_main"
android:background="@drawable/name_of_your_background"
/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.