本文整理匯總了TypeScript中react-native.StyleSheet.create方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript StyleSheet.create方法的具體用法?TypeScript StyleSheet.create怎麽用?TypeScript StyleSheet.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類react-native.StyleSheet
的用法示例。
在下文中一共展示了StyleSheet.create方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
import { StyleSheet } from 'react-native'
export default StyleSheet.create({
container: {
flex: 1,
},
})
示例2:
import { colors, screenWidth } from "../styles";
import {
StyleSheet,
} from 'react-native';
let textColor = colors.white;
export const tutorialStyle = StyleSheet.create({
header: {
color: textColor.hex,
fontSize: 25,
fontWeight:'800'
},
text: {
color: textColor.hex,
fontSize: 16,
textAlign:'center',
fontWeight:'500'
},
subText: {
color: textColor.rgba(0.5),
fontSize: 13,
},
explanation: {
width: screenWidth,
color: textColor.rgba(0.5),
fontSize: 13,
textAlign:'center'
}
});
示例3:
export default StyleSheet.create({
wrapper: {
width: '100%',
borderColor: '#e0e0e0',
height: AUDIO_HEIGHT,
borderWidth: 1,
borderRadius: 2,
backgroundColor: 'white'
},
container: {
flexDirection: 'row',
paddingHorizontal: 8,
width: '100%',
},
progressBar: {
width: '100%',
height: PROGRESS_BAR_HEIGHT,
backgroundColor: '#c9c9c9'
},
progressBarTint: {
height: PROGRESS_BAR_HEIGHT,
backgroundColor: '#09BB07'
},
poster: {
width: AUDIO_HEIGHT - 2 - PROGRESS_BAR_HEIGHT,
height: AUDIO_HEIGHT - 2 - PROGRESS_BAR_HEIGHT,
backgroundColor: '#e6e6e6'
},
posterImg: {
width: '100%',
height: '100%',
justifyContent: 'center',
alignItems: 'center',
},
playIcon: {
textAlign: 'center',
},
info: {
flex: 1,
flexDirection: 'row',
justifyContent: 'space-between',
paddingVertical: 6,
paddingHorizontal: 14,
height: AUDIO_HEIGHT - 2 - PROGRESS_BAR_HEIGHT,
},
detail: {
justifyContent: 'center'
},
name: {
},
nameText: {
fontSize: 13,
color: '#353535'
},
author: {
marginTop: 9
},
authorText: {
fontSize: 12,
color: '#888'
},
time: {
},
timeText: {
fontSize: 10,
color: '#888'
}
})
示例4: LightTheme
import { StyleSheet } from 'react-native';
import { colors, LightTheme, dimensions } from './lightTheme';
const darkColors = {
...colors,
background: '#343a40',
foreground: '#ffffff',
};
export const darkTheme = StyleSheet.create(
new LightTheme(darkColors, dimensions),
);
示例5: removeDisplay
export function create<T>(style: T): T {
removeDisplay(style);
return StyleSheet.create(style);
}
示例6:
} from 'react-native';
import {colors} from "../../styles";
export const WNStyles = StyleSheet.create({
important: {
fontSize: 14,
fontWeight:'bold',
color: colors.red.hex,
textAlign:'center'
},
text: {
fontSize: 15,
fontWeight:'bold',
color: colors.csBlue.hex,
textAlign:'center'
},
detail: {
fontSize: 13,
color: colors.csBlue.rgba(0.75),
textAlign:'center'
},
innerScrollView: {
alignItems: 'center',
paddingBottom: 50,
paddingLeft: 10,
paddingRight: 10,
},
outerScrollView: {
},
});
示例7: LightTheme
...buttonPadding,
...this.borderGrayLight,
};
this.buttonDisabled = {
opacity: 0.5,
};
this.validationError = {
...this.textSmall,
color: colors.danger,
fontWeight: 'bold',
minHeight: typography.lineHeight,
};
this.marginStartAuto = {
marginStart: 'auto',
};
this.label = {
...this.textSmall,
color: colors.gray,
padding: typography.lineHeight / 6,
textTransform: 'uppercase',
};
}
}
export const lightTheme = StyleSheet.create(new LightTheme(colors, dimensions));
export type Theme = typeof lightTheme;
示例8:
export default StyleSheet.create({
safeAreaView: {
flex: 1,
backgroundColor: bg,
},
scrollView: {
flex: 1,
},
safeAreaViewBlack: {
flex: 1,
backgroundColor: "black",
},
scrollViewNotBlack: {
flex: 1,
backgroundColor: bg,
},
viewAppleBar: {
padding: 16,
},
viewAppleBarContent: {
paddingBottom: 8,
borderBottomWidth: 1,
borderBottomColor: elBg,
},
viewAppleBarRow: {
flexDirection: "row",
},
viewMotd: {
margin: 16,
backgroundColor: elBg,
padding: 16,
borderRadius: 16,
shadowRadius: 6,
shadowOffset: {
width: 0,
height: 4,
},
shadowOpacity: 0.1,
},
viewAnimeList: {
paddingTop: 16,
},
viewEpisodeList: {
flex: 1,
width: "100%",
},
});
示例9:
export const topBarStyle = StyleSheet.create({
topBar: {
backgroundColor: colors.menuBackground.hex,
flexDirection: 'row',
paddingTop: statusBarHeight
},
topBarCenterView: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
topBarLeft: {
textAlign: 'left',
},
topBarLeftTouch: {
// backgroundColor:'#ff0',
height:barHeight,
width:80,
paddingLeft: 10,
alignItems:'flex-start',
justifyContent:'center'
},
topBarRightTouch: {
// backgroundColor:'#ff0',
height:barHeight,
width:80,
paddingRight: 10,
},
topBarCenter: {
textAlign: 'center',
},
topBarRight: {
textAlign: 'right',
},
titleText: {
fontSize: 18,
color: 'white'
},
text:{
fontSize: 17,
fontWeight:'bold',
color: colors.menuTextSelected.hex
}
});