简体   繁体   English

我们如何设置或更改滑动布局或回收视图(如 Whatsapp 聊天)的背景

[英]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.

相关问题 如何像whatsapp聊天布局一样更改我的聊天布局输出? - How to change my chat layout output as like whatsapp chat layout? 聊天布局像whatsapp - Chat layout like whatsapp 如何像 WhatsApp 聊天一样创建回收者视图 - How to create recycler view like WhatsApp chat 每次滑动视图分页器时如何更改标题布局(带选项卡布局) - How can I change header layout every time swipe view pager(with tab layout) 带有回收视图的刷卡 - swipe cards with recycle view android - 如何像whatsapp一样设置listView项目背景 - android - How to set listView item background like whatsapp 如何制作像WhatsApp Chat活动一样的RecylerView? - How to make a RecylerView like WhatsApp Chat activity? 如何在没有唤醒设备的情况下像 WhatsApp 一样在后台运行服务来备份聊天? - How to run service in background like WhatsApp does for taking backup of the chat without wake up device? 如何在布局xml中添加循环视图 - How to add recycle view in layout xml 如何为所有域设置 WebView 权限,如谷歌 map 链接 whatsapp 聊天链接 - How to set WebView permission for all domain like google map link whatsapp chat link
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM