Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义布局,background属性无效 #6

Closed
Xbigfat opened this issue May 21, 2018 · 3 comments
Closed

自定义布局,background属性无效 #6

Xbigfat opened this issue May 21, 2018 · 3 comments

Comments

@Xbigfat
Copy link

Xbigfat commented May 21, 2018

作者你好!使用 .setEmptyLayout(R.layout.custom_layout) 时,自定义的layout中 background 属性无效,请帮看看是哪里的问题呢?
XML:
`

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/ic_no_data" />

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/no_data_tips"
    android:textColor="@color/primary"
    android:textSize="16sp" />

`

这里设置了橘色的背景布局,但在App中不是橘色。

@Bakumon
Copy link
Owner

Bakumon commented May 21, 2018

@Xbigfat

1. Builder有一个统一设置背景色的方法:

Builder#setDefaultLayoutsBackgroundColor(int color)

这个方法会统一设置 LoadingEmpty、 Error` 布局的背景色。

2. 可以通过覆盖 color 来设置背景颜色

color.xml,覆盖 status_layout_background_color


以上两种方法,目前会改变默认三种内置布局类型的背景颜色(包括默认布局和自定义布局),自定义类型布局不受影响。

这其实是一个错误,这个方法应该是修改默认三种布局的背景色的。

我会改掉,然后发新版。

感谢发现问题🙏

@Xbigfat
Copy link
Author

Xbigfat commented May 21, 2018

解决问题!
我看了此方法,但是我以为该方法仅针对于默认布局,并未想到该方法亦会影响到自定义布局。
感谢说明。

@Xbigfat Xbigfat closed this as completed May 21, 2018
Bakumon added a commit that referenced this issue May 21, 2018
Bakumon added a commit that referenced this issue May 21, 2018
@Bakumon
Copy link
Owner

Bakumon commented May 21, 2018

@Xbigfat 问题已经解决

升级 1.0.3 版本,下面方法只会改变默认布局的背景色。

Builder#setDefaultLayoutsBackgroundColor(int color)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants