React-Native学习笔记(1)

本文详细介绍了 React Native 中图片的样式设置方法,包括不同 resize 模式的应用效果对比。此外,还深入探讨了文本输入组件的使用技巧,例如如何设置 maxLength、placeholder 和键盘类型等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

react-native image Style

resizeMode:

cover:等比拉伸

strech:保持原有大小 

 

contain:图片拉伸  充满空间

 

可编辑文本

<EditText
	maxLength={15}
	ref={'money'}
	placeholder={'输入金额'}
	placeholderTextColor={'lightGrey'}
	textAlignVertical={'bottom'}
	textAlign={iosPlatform?'center':'center'}
	keyboardType={'numeric'}
	defaultValue={this.onShowBalance}
	underlineColorAndroid={themeColor}
	onChangeText={(text)=>this.submitButtonStateChangeByMoney(text)}
	style={[styles.otherMoney,
	iosPlatform&&{height:StyleShit.getVerticalDimension(27)}]}

 

文本框

<TextInput
	ref={'money'}
	placeholder={'存入其他金额'}
	placeholderTextColor={'#b7242c'}
	textAlignVertical={'bottom'}
	textAlign={iosPlatform?'left':'start'}
	keyboardType={'numeric'}
	underlineColorAndroid='#471d5b'
	onChangeText={(text)=>{
		console.log('onChangetext text == '+text);
		this.showIncomeTips();
		this.money = text;}
	}
	style={[styles.otherMoney,
	iosPlatform&&{height:StyleShit.getVerticalDimension(27)}]}/>

 

 

转载于:https://www.cnblogs.com/mjian/p/9250145.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值