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范围
1565浏览 • 1回复 待解决
HarmonyOS TextInput超出父容器
638浏览 • 1回复 待解决
HarmonyOS Row组件怎么居中
887浏览 • 1回复 待解决
HarmonyOS 文字在Row中不居中
971浏览 • 1回复 待解决
Flex布局完全替代column、row
1356浏览 • 2回复 待解决
spark Dataset<Row>如何按行获取数据?
3138浏览 • 1回复 待解决
HarmonyOS Row 怎么设置中间最大宽度
712浏览 • 1回复 待解决
HarmonyOS Row()为什么不能添加圆角
1059浏览 • 1回复 待解决
HarmonyOS TextInput问题
636浏览 • 1回复 待解决
HarmonyOS TextInput使用
1367浏览 • 1回复 待解决
TextInputdefaultFocus不响应
2380浏览 • 1回复 待解决
HarmonyOS TextInput组件使用
812浏览 • 1回复 待解决
HarmonyOS TextInput焦点问题
1356浏览 • 1回复 待解决
TextInput怎么输入中文
4456浏览 • 0回复 待解决
HarmonyOS TextInput 换行问题
1721浏览 • 1回复 待解决