我是史密斯的新手.如何从Swift代码运行此过程?
cd Desktop/firebase-macnpm start我实际上要做的是从Swift代码点击启动Node服务器.
无法在android的webview上显示浮动按钮。iOS工作正常,在Android上不显示。
渲染功能:
<View style={{ flex: 1}}>
<View style={{position:'absolute',right:0,marginTop:90,marginRight:10,zIndex:1,height:50,width:50}}>
<TouchableHighlight style={styles.addButton}
underlayColor='#ff7043' onPress={()=>{console.log('pressed')}}>
<Text style={{fontSize: 50, color: 'black'}}>+</Text>
</TouchableHighlight>
</View>
<WebView
source={require('./index.html')}
style={{marginTop:0}}
scalesPageToFit={Platform.OS !== 'ios'}
onMessage={this.onMessage}
postMessage={"Hello from RN"}
/>
</View>
Run Code Online (Sandbox Code Playgroud)
CSS:
const styles = StyleSheet.create({
addButton: {
backgroundColor: '#ff5722',
borderColor: '#ff5722',
borderWidth: 1,
height: 100,
width: 100,
borderRadius: 50,
alignItems: 'center',
justifyContent: 'center',
position: 'absolute',
bottom: 20,
right:20,
shadowColor: "#000000",
shadowOpacity: 0.8,
shadowRadius: 2,
shadowOffset: {
height: 1,
width: 0
}
}
});
Run Code Online (Sandbox Code Playgroud)
如何在android的Web视图上显示按钮?
byte[] bytes = System.IO.File
.ReadAllBytes(
HttpContext.Current.Server.MapPath("~/Images/orderedList1.png"));
var result_ = new HttpResponseMessage(HttpStatusCode.OK);
result_.Content = new ByteArrayContent(bytes);
result_.Content.Headers.ContentType = new MediaTypeHeaderValue("image/png");
return result_;
Run Code Online (Sandbox Code Playgroud)
android ×1
asp.net-mvc ×1
bash ×1
c# ×1
macos ×1
node.js ×1
react-native ×1
reactjs ×1
swift ×1
terminal ×1