每条一个Deveco Studio Next 小技巧,话不多说,马上开始~
先新建一个空项目。
打开Index.ets,一般默认已经打开。
- @Entry
- @Component
- struct Index {
- @State text: string = ''
- build() {
- RelativeContainer() {
- TextInput({placeholder: "我是TextInput~"}) // placeholder 设置提示语
- .fontSize(25) // 字体大小 25
- .margin({left: 25, right: 25, top: 30}) // 左缩进 25,右缩进 25,上缩进 30
- .onChange((value: string) => {
- this.text = value;
- })
- Text('你输入了: ' + this.text)
- .margin({left: 25, top: 100})
- }
- .height('100%')
- .width('100%')
- }
- }
复制代码 Deveco Studio TextInput 效果
更多问题去华为官方博客看~
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |