ReactNativeで縦長のボタンを作りたい

前回の用途で行くと、ボタンは縦横にできるだけ大きい方が、リモコン操作でカーソルを合わせやすいとのことで、React NativeでButtonコンポーネントをみると、heightを設定できないとのこと。

幅だけなら、Viewコンポーネントで挟んで、Viewの方に、widthプロパティで設定できるようだが、、、

縦の長さを長くするには下記HP参照

https://stackoverflow.com/questions/41777884/how-to-set-the-height-of-button-in-react-native-android/41778004#41778004

 

ということで作成してみました。

import { StyleSheet} from 'react-native';
import { Button, View, Alert, TouchableOpacity, Text} from 'react-native';
import { useState } from 'react';
import YoutubePlayer from 'react-native-youtube-iframe';


export default function App() {
  return (
    <View>
      <TouchableOpacity style={{justifyContent:"center",alignItems:"center",height: 100,width:100, backgroundColor:"blue"}}>
        <Text style={{color:"white"}}>My Button</Text>
      </TouchableOpacity>
    </View>
  );
}