row中放入textinput,textinput会超出row的范围

在一个row中存放了text和textinput,无论row设置padding还是margin,textinput都会超出row的显示范围。

HarmonyOS
2024-10-09 09:58:11
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
put_get

TextInput增加margin属性,距离右边设置长度,demo:

build() {  
  // Row() {  
  Column() {  
    Row() {  
      Text('asd');  
      TextInput({placeholder: '输入'})  
        .maxLines(3)  
        .type(InputType.Password)  
        .borderRadius(0)  
        .height(40)  
        .backgroundColor(Color.Blue)  
        .margin({right: 50})  
    }  
    .height(50)  
    .padding({left: 20, right: 20})  
    .backgroundColor(Color.Black)  
  
  }  
  .width('100%')  
  .height('100%')  
}
分享
微博
QQ
微信
回复
2024-10-09 16:42:04
相关问题
HarmonyOS row子控件超出row范围
1619浏览 • 1回复 待解决
HarmonyOS TextInput超出父容器
686浏览 • 1回复 待解决
HarmonyOS Row组件怎么居中
939浏览 • 1回复 待解决
HarmonyOS 文字在Row中不居中
1035浏览 • 1回复 待解决
Flex布局完全替代column、row
1438浏览 • 2回复 待解决
spark Dataset<Row>如何按行获取数据?
3179浏览 • 1回复 待解决
HarmonyOS Row 怎么设置中间最大宽度
776浏览 • 1回复 待解决
HarmonyOS Row()为什么不能添加圆角
1117浏览 • 1回复 待解决
HarmonyOS TextInput问题
691浏览 • 1回复 待解决
HarmonyOS TextInput组件使用
842浏览 • 1回复 待解决
TextInputdefaultFocus不响应
2430浏览 • 1回复 待解决
HarmonyOS TextInput使用
1411浏览 • 1回复 待解决
HarmonyOS TextInput 换行问题
1786浏览 • 1回复 待解决