Android-具有一个布局,多个set的RecyclerView

Android-具有一个布局,多个set的RecyclerView,第1张

Android-具有一个布局,多个set的RecyclerView

您也需要设置

else
条件。像下面的例子

// if no url is found from serverif(url == null){  ((ObjectViewHolder) holder).userPostImageWrapper.setVisibility(View.GONE);  ((ObjectViewHolder) holder).userPostYoutubeImageWrapper.setVisibility(View.GONE);} else {  // Some url has found   ((ObjectViewHolder) holder).userPostImageWrapper.setVisibility(View.VISIBLE);  ((ObjectViewHolder) holder).userPostYoutubeImageWrapper.setVisibility(View.VISIBLE);}

如果要在运行时设置其可见性,请对作为列表项的每个项执行此 *** 作。



欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5131358.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-17
下一篇2022-11-17

发表评论

登录后才能评论

评论列表(0条)

    保存