修改单选框边距大小

This commit is contained in:
lyswhut
2023-08-18 09:03:38 +08:00
parent a3e8533700
commit a8b169d4d9

View File

@ -8,6 +8,7 @@ import {
} from 'react-native' } from 'react-native'
import { Icon } from '../Icon' import { Icon } from '../Icon'
import { createStyle } from '@/utils/tools'
import { scaleSizeW } from '@/utils/pixelRatio' import { scaleSizeW } from '@/utils/pixelRatio'
export interface Props { export interface Props {
@ -34,7 +35,7 @@ export interface Props {
} }
const ANIMATION_DURATION = 200 const ANIMATION_DURATION = 200
const WIDTH = scaleSizeW(32) const PADDING = scaleSizeW(4)
/** /**
* Checkboxes allow the selection of multiple options from a set. * Checkboxes allow the selection of multiple options from a set.
@ -85,7 +86,7 @@ const Checkbox = ({
accessibilityRole="checkbox" accessibilityRole="checkbox"
accessibilityState={{ disabled, checked }} accessibilityState={{ disabled, checked }}
accessibilityLiveRegion="polite" accessibilityLiveRegion="polite"
style={styles.container} style={{ ...styles.container, padding: PADDING }}
> >
<Icon <Icon
allowFontScaling={false} allowFontScaling={false}
@ -109,10 +110,8 @@ const Checkbox = ({
Checkbox.displayName = 'Checkbox' Checkbox.displayName = 'Checkbox'
const styles = StyleSheet.create({ const styles = createStyle({
container: { container: {
width: WIDTH,
height: WIDTH,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
// backgroundColor: 'rgba(0, 0, 0, 0.2)', // backgroundColor: 'rgba(0, 0, 0, 0.2)',