This commit is contained in:
oneao committed 2026-03-02 17:29:51 +08:00
1 parent ab3eaed7ce
commit cf23acdabc
28 files changed
+1292 -486

No files matched your search

+29 -64
View File
@@ -1,68 +1,33 @@
import React from 'react'
import {
StyleSheet,
Text,
TextInput,
TouchableOpacity,
View,
} from 'react-native'
import { KeyboardAvoidingView } from 'react-native-keyboard-controller'
import React, { useState } from 'react'
import { Text, View } from 'react-native'
import { AButton, AModal } from '@/components/common/ao'
import AnimatedSwitch from '@/components/common/ao/Switch'
export default function TestScreen() {
const [showDissolve, setShowDissolve] = useState(false)
export default function KeyboardAvoidingViewExample() {
return (
<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>
</KeyboardAvoidingView>
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<AButton onPress={() => {
setShowDissolve(true)
}}
>
测试
</AButton>
<AModal
title="提示"
body="确认解散该空间么?"
isOpen={showDissolve}
onClose={() => {
setShowDissolve(false)
}}
onCancel={() => {
setShowDissolve(false)
}}
onConfirm={() => {
setShowDissolve(false)
}}
/>
</View>
)
}
const styles = StyleSheet.create({
content: {
flex: 1,
maxHeight: 600,
},
heading: {
fontSize: 36,
marginBottom: 48,
fontWeight: '600',
},
inner: {
padding: 24,
flex: 1,
justifyContent: 'space-between',
},
textInput: {
height: 45,
borderColor: '#000000',
borderWidth: 1,
borderRadius: 10,
marginBottom: 36,
paddingLeft: 10,
},
button: {
marginTop: 12,
height: 45,
borderRadius: 10,
backgroundColor: 'rgb(40, 64, 147)',
justifyContent: 'center',
alignItems: 'center',
},
text: {
fontWeight: '500',
fontSize: 16,
color: 'white',
},
})