-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Description
调试时发现:
View positionView = horizontalGridView.getChildAt(Constants.TAG_FEATURE_POSITION);获取到的positionView 为null;
不知道为什么会为null,有点奇怪,不知道作者有发现没有。

我是这么处理的,可以解决问题
//延时一会儿,否则positionView获取为null
postDelayed(new Runnable() {
@Override
public void run() {
horizontalGridView.setSelectedPositionSmooth(Constants.TAG_FEATURE_POSITION);
View positionView = horizontalGridView.getChildAt(Constants.TAG_FEATURE_POSITION);
if (positionView != null) {
activity.mOldTitle = positionView.findViewById(R.id.tv_main_title);
positionView.requestFocus();
}
}
}, 0);
Metadata
Metadata
Assignees
Labels
No labels
