ReactNative Demo - Dimensions 的使用
import React, {
Component
} from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Image,
DrawerLayoutAndroid,
ListView,
PixelRatio,
TextInput,
Dimensions,
} from 'react-native';
class AwesomeProject extends Component {
render() {
return (
<View style={styles.container}>
<View style={styles.child} />
</View>
);
}
}
class Search extends Component{
render(){
return(
<View style={[styles.flex,styles.flexDirection]}>
<View style={[styles.flex,styles.input]}>
<TextInput></TextInput>
</View>
<View style={styles.btn}>
<Text style={styles.search}>搜尋</Text>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
flex: {
flex:1,
},
flexDirection :{
flexDirection:'row',
},
topStatus : {
marginTop : 25,
} ,
input:{
height:45,
borderColor:'red',
borderWidth: 1,
marginLeft:10,
borderRadius:5,
paddingLeft:10,
},
btn:{
height:45,
width:45,
marginLeft:-5,
marginRight:5,
backgroundColor:'#23BEFF',
alignItems:'center',
justifyContent:'center',
},
search:{
color:'#fff',
fontWeight:'bold',
fontSize:15,
},
container: {
backgroundColor:'green',
flex: 1,
},
child: {
flex: 1,
backgroundColor: 'blue',
transform: [
{
perspective: 850
},
{
translateX: -Dimensions.get('window').width * 0.24
},
{
rotateY: '60deg'
},
],
}
});
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
相關文章
- ReactNative Demo - ImageVIew 使用ReactView
- ReactNative Demo - NavigationView 使用ReactNavigationView
- ReactNative Demo - Navigator 使用React
- ReactNative Demo -SearchInputReact
- ReactNative Demo - 仿攜程UI DemoReactUI
- ReactNative 仿網易新聞UI DemoReactUI
- Overview of Dimensions (191)View
- 在 ReactNative 中使用友盟分享React
- ReactNative-Navigator元件使用總結React元件
- 使用vue寫的計算器demoVue
- ValueError: output parameter for reduction operation logical_and has too many dimensions ?Error
- reactnative外掛react-navigation使用心得ReactNavigation
- 安卓Toolbar使用 Demo(Kotlin)安卓Kotlin
- ReactNative與iOS的互動ReactiOS
- 使用DeepKE訓練命名實體識別模型DEMO(官方DEMO)模型
- ReactNative入門React
- ONE-ReactNativeReact
- MAC下使用OpenCV的例項簡單DemoMacOpenCV
- WPF所有原生空間使用demo
- ReactNative初體驗React
- ReactNative分包實踐React
- ReactNative版友盟推送React
- ReactNative實現ToastReactAST
- ReactNative環境搭建React
- ReactNative之NavigatorReact
- ReactNative 生命週期React
- ReactNative仿《ONE》APPReactAPP
- ReactNative呼叫原生模組React
- ReactNative flex 佈局ReactFlex
- Weex & ReactNative & JSPatchReactJS
- ReactNative元件詳解React元件
- ReactNative iOS 互動ReactiOS
- dva框架使用詳解及Demo教程框架
- 使用CodeModel生成Java類Java
- ReactNative 到 Weex 的艱難一邁React
- ReactNative之手勢識別React
- ReactNative常見問題React
- ReactNative WebView元件詳解ReactWebView元件