ユーザ用ツール

サイト用ツール


サイドバー

reactnative:サイズ取得

以前のリビジョンの文書です


サイズ取得

画面サイズ取得

const Dimensions = require('Dimensions')
const { width, height, scale } = Dimensions.get('window')

// my HTC U12+ の場合
[18:09:44] 411.42857142857144 //width
[18:09:44] 683.4285714285714 //height
[18:09:44] 2.625 //scale

ヘッダーやステータスバー

import { Header } from 'react-navigation'
import { StatusBar } from 'react-native'

・・・
console.log("Header.HEIGHT:" + Header.HEIGHT)
console.log("StatusBar .HEIGHT:" + StatusBar .HEIGHT)
reactnative/サイズ取得.1549853748.txt.gz · 最終更新: 2019/02/11 11:55 by ips