u
This commit is contained in:
1 parent
68a834dd18
commit
a52e73fbba
9 files changed
+255
-141
No files matched your search
@@ -1,39 +1,68 @@
|
||||
import React, { useState } from 'react'
|
||||
import { KeyboardAvoidingView, Platform, StyleSheet, View } from 'react-native'
|
||||
import { KeyboardProvider } from 'react-native-keyboard-controller'
|
||||
import { AInput } from '@/components/common/ao'
|
||||
import React from 'react'
|
||||
import {
|
||||
StyleSheet,
|
||||
Text,
|
||||
TextInput,
|
||||
TouchableOpacity,
|
||||
View,
|
||||
} from 'react-native'
|
||||
import { KeyboardAvoidingView } from 'react-native-keyboard-controller'
|
||||
|
||||
export default function MyInput() {
|
||||
export default function KeyboardAvoidingViewExample() {
|
||||
return (
|
||||
<View style={styles.content}>
|
||||
<View style={styles.topSpace} />
|
||||
|
||||
{/* 输入框 */}
|
||||
<View style={styles.inputWrapper}>
|
||||
<AInput
|
||||
value=""
|
||||
placeholder="备注"
|
||||
className="bg-[#f2f3f5] border-0"
|
||||
size="sm"
|
||||
/>
|
||||
<KeyboardAvoidingView
|
||||
behavior="padding"
|
||||
keyboardVerticalOffset={100}
|
||||
style={styles.content}
|
||||
>
|
||||
<View style={styles.inner}>
|
||||
<Text style={styles.heading}>Header</Text>
|
||||
<View>
|
||||
<TextInput placeholder="Username" style={styles.textInput} />
|
||||
<TextInput placeholder="Password" style={styles.textInput} />
|
||||
</View>
|
||||
<TouchableOpacity style={styles.button}>
|
||||
<Text style={styles.text}>Submit</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
</KeyboardAvoidingView>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
},
|
||||
content: {
|
||||
flex: 1,
|
||||
maxHeight: 600,
|
||||
},
|
||||
heading: {
|
||||
fontSize: 36,
|
||||
marginBottom: 48,
|
||||
fontWeight: '600',
|
||||
},
|
||||
inner: {
|
||||
padding: 24,
|
||||
flex: 1,
|
||||
justifyContent: 'space-between',
|
||||
},
|
||||
topSpace: {
|
||||
flex: 1,
|
||||
textInput: {
|
||||
height: 45,
|
||||
borderColor: '#000000',
|
||||
borderWidth: 1,
|
||||
borderRadius: 10,
|
||||
marginBottom: 36,
|
||||
paddingLeft: 10,
|
||||
},
|
||||
inputWrapper: {
|
||||
marginHorizontal: 16,
|
||||
marginBottom: 20,
|
||||
button: {
|
||||
marginTop: 12,
|
||||
height: 45,
|
||||
borderRadius: 10,
|
||||
backgroundColor: 'rgb(40, 64, 147)',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
text: {
|
||||
fontWeight: '500',
|
||||
fontSize: 16,
|
||||
color: 'white',
|
||||
},
|
||||
})
|
||||
Reference in new issue
Block a user