HarmonyOS responseRegion

.responseRegion([{ x: "-100%", y: "-100%", width: '300%', height: '300%' }])

负值似乎当成了正值在处理?或者没有生效,预期是扩大1倍的触摸区域,实际上压根不知道区域在哪了。

HarmonyOS
2024-10-28 09:55:19
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
zxjiu

​参考链接:

https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-universal-attributes-hit-test-behavior-V5#hittestbehavior

@Entry  
@Component  
export struct ExpandTextComponent {  
  @State text: string = ''  
  controller: TextAreaController = new TextAreaController()  
  
  build() {  
    Stack() {  
      Column({ space: 20 }) {  
        Button("啊啊啊啊")  
          .onClick(() => {  
            this.text += '1'  
          })  
  
          .responseRegion({ x: '-100%', y: '-100%', width: '200%', height: '200%' })  
  
        Text(this.text).margin({ top: 50 })  
      }.width('100%').margin({ top: 10 })  
      .zIndex(2)  
      .hitTestBehavior(HitTestMode.Transparent)  
      //TODO  
      Stack().size({  
        width:"100%",  
        height:"100%"  
      })  
    }  
    .backgroundColor(Color.Orange)  
    .size({ width:'100%',height:'100%' })  
  }  
}
分享
微博
QQ
微信
回复
2024-10-28 15:16:57
相关问题
HarmonyOS 如何扩大组件点击区域
1671浏览 • 1回复 待解决
HarmonyOS jsbridge HarmonyOS版本
921浏览 • 1回复 待解决
HarmonyOS HarmonyOS社区组件问题
1638浏览 • 1回复 待解决
HarmonyOS JsBridge的HarmonyOS版本sdk
974浏览 • 1回复 待解决
HarmonyOS HarmonyOS签名验签问题
1167浏览 • 1回复 待解决
HarmonyOS react-native-screens HarmonyOS计划
1077浏览 • 1回复 待解决
HarmonyOS gesture
647浏览 • 1回复 待解决
HarmonyOS TabContent
1110浏览 • 1回复 待解决
HarmonyOS bouncycastle
695浏览 • 1回复 待解决
HarmonyOS NodeRender
679浏览 • 1回复 待解决
HarmonyOS DatePicker
952浏览 • 1回复 待解决
Harmonyos next
234浏览 • 0回复 待解决
HarmonyOS readPixelsToBuffer
630浏览 • 1回复 待解决
HarmonyOS Websocket?
918浏览 • 0回复 待解决
HarmonyOS onAreaChange
794浏览 • 1回复 待解决
HarmonyOS HarmonyOS的视频流和操作流
1028浏览 • 1回复 待解决
HarmonyOS 可以用仓颉开发HarmonyOS
1267浏览 • 1回复 待解决