前端之家收集整理的这篇文章主要介绍了
react native封装UI,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
package com.reactts.speedview
import com.github.anastr.speedviewlib.AwesomeSpeedometer
import com.github.anastr.speedviewlib.Speedometer
import com.github.anastr.speedviewlib.PointerSpeedometer
import com.facebook.react.uimanager.SimpleViewManager
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager
import java.util.List
import java.util.ArrayList
import java.util.Collections
import java.util.Arrays
public class ReactSpeedManager extends SimpleViewManager<AwesomeSpeedometer> {
public static final String REACT_CLASS = "RCTSpeedView"
@Override
public String getName() {
return REACT_CLASS
}
@Override
public AwesomeSpeedometer createViewInstance(ThemedReactContext context) {
AwesomeSpeedometer aw= new AwesomeSpeedometer(context)
return aw
}
public List<ViewManager> createViewManagers(
ReactApplicationContext reactContext) {
return Arrays.<ViewManager>asList(
new ReactSpeedManager()
)
}
}