您好,我正在使我的應用程式產生共鳴,我遇到了尺寸,發現它很容易使用我真的不知道是否推薦它,因為我還不太熟悉它。現在我的android模擬器中的問題一切看起來都很好,因為它應該文本框調整到大小并且文本也在文本框的中間但是在我真正的android設備上,文本被向上移動了很多有沒有人知道我可以修復這個?
我的代碼:
//On the top to get the Dimensions
let height = Dimensions.get('window').height;
let width = Dimensions.get('window').width;
我的文本輸入:
<TextInput
autoCapitalize="none"
autoCorrect={false}
style={styles.inputStyle}
placeholder="Name"
value={clientName}
onChangeText={setClientName}
/>
還有我的回應式輸入風格:
inputStyle: {
width: width * 0.7,
height: height* 0.06,
fontSize: height * 0.03,
textAlign: 'center',
backgroundColor: '#D6D6D6',
color: '#000',
borderRadius: 10,
},
這是我真實設備的截圖

uj5u.com熱心網友回復:
嘗試添加 padding: 0 樣式。它將洗掉文本周圍的空白。
inputStyle: {
width: width * 0.7,
height: height* 0.06,
fontSize: height * 0.03,
textAlign: 'center',
backgroundColor: '#D6D6D6',
color: '#000',
borderRadius: 10,
padding: 0,
},
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/516535.html
標籤:安卓反应式
上一篇:如何在flutter中添加ExpansionPanelList之間的間隙?
下一篇:從網站獲取空標簽
