2017-06-21 58 views

回答

3

您可以創建樣式表並使用RN的Platform API來區分OS是Android還是iOS。

示例代碼:

import { Platform } from 'react-native' 

const device = Platform.OS 
const styles = { 
    header: { 
    backgroundColor: device === "android" ? "#424242" : "#F8F8F8" 
    } 
} 

module.exports = styles 
相關問題