我无法使用React Native包装自定义Android布局并获取嵌套ScrollView
进行滚动。布局是Android' SwipeRefreshLayout。
看起来触摸正好穿过布局 - 我可以按ScrollView
内的可触摸内容。但由于某种原因,滚动动作不会被传递。顺便说一句,我已经使用FrameLayout
以及SwipeRefreshLayout
进行了测试,但它也没有使用public class ReactSwipeRefreshLayoutManager extends ViewGroupManager<android.support.v4.widget.SwipeRefreshLayout> {
public static final String REACT_CLASS = "RCTSwipeRefreshLayout";
@UIProp(UIProp.Type.STRING)
public static final String PROP_COLOR = "color";
@Override
public String getName() {
return REACT_CLASS;
}
@Override
protected ReactSwipeRefreshLayout createViewInstance(ThemedReactContext themedReactContext) {
return new ReactSwipeRefreshLayout(themedReactContext);
}
@Override
public void updateView(SwipeRefreshLayout layout, CatalystStylesDiffMap props) {
// BaseViewPropertyApplicator.applyCommonViewProperties(layout, props);
layout.setColorSchemeColors(Color.parseColor(props.getString(PROP_COLOR)));
}
}
。
<SwipeRefresh color='blue'>
<ScrollView>
{/* More stuff goes here... */}
</ScrollView>
</SwipeRefresh>
NSDateComponents *components = [CURRENT_CALENDAR components:DATE_COMPONENTS fromDate:_startDate];
[components setHour:0];
[components setMinute:0];
[components setSecond:0];
_date = [CURRENT_CALENDAR dateFromComponents:components];