在自定义布局中为Android ScrollView反应Native

时间:2015-09-24 12:38:16

标签: android react-native

我无法使用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))); } }

Java ViewGroupManager

  <SwipeRefresh color='blue'>
    <ScrollView>
        {/* More stuff goes here... */}
    </ScrollView>
  </SwipeRefresh>

React Native布局:

NSDateComponents *components = [CURRENT_CALENDAR components:DATE_COMPONENTS fromDate:_startDate];
[components setHour:0];
[components setMinute:0];
[components setSecond:0];
_date = [CURRENT_CALENDAR dateFromComponents:components];

0 个答案:

没有答案