被包裹的控件,id必须为swipe_target? 在哪里有说明吗?
pdog18 opened this issue · 6 comments
pdog18 commented
被包裹的控件,id必须为swipe_target? 在哪里有说明吗?
Aspsine commented
https://github.com/Aspsine/SwipeToLoadLayout/wiki/Quick-Setup
Note:
refresh header view android:id="@id/swipe_refresh_header"
target view android:id="@id/swipe_target"
load more footer view android:id="@id/swipe_load_more_footer"
pdog18 commented
谢谢您的回复,能否在找不到对应id的时候主动抛出异常呢?
另外想向您请教一下,给控件设置id找到目标子控件,和 getChildAt()有什么区别吗?
Aspsine commented
设置id的话,swipetoloadlayout中的child顺序没要求。getChildAt(int)有要求。
pdog18 commented
嗯谢谢您的回复,您的做法很有道理,
我自己想了一想的确是这样的
不过提一个微小的建议,如果找不到相应的view 还是抛出一个异常来崩溃掉项目吧,昨天因为自己粗心,找了很久才找出原因,(因为自己第一次接触用id去寻找相关控件,经验不足)
谢谢您的项目,很棒,我感觉非常好用,相关api都是非常容易清晰调用的