HarmonyOS responseRegion

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

负值似乎当成了正值在处理?或者没有生效,预期是扩大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%' })  
  }  
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
分享
微博
QQ
微信
回复
2024-10-28 15:16:57
相关问题
HarmonyOS 如何扩大组件点击区域
1281浏览 • 1回复 待解决
HarmonyOS jsbridge HarmonyOS版本
682浏览 • 1回复 待解决
HarmonyOS HarmonyOS社区组件问题
1306浏览 • 1回复 待解决
HarmonyOS JsBridge的HarmonyOS版本sdk
783浏览 • 1回复 待解决
HarmonyOS HarmonyOS签名验签问题
931浏览 • 1回复 待解决
HarmonyOS react-native-screens HarmonyOS计划
836浏览 • 1回复 待解决
HarmonyOS HarmonyOS的视频流和操作流
821浏览 • 1回复 待解决
HarmonyOS 可以用仓颉开发HarmonyOS
941浏览 • 1回复 待解决
HarmonyOS DatePicker
677浏览 • 1回复 待解决
HarmonyOS bouncycastle
489浏览 • 1回复 待解决
HarmonyOS gesture
504浏览 • 1回复 待解决
HarmonyOS readPixelsToBuffer
485浏览 • 1回复 待解决
HarmonyOS onAreaChange
516浏览 • 1回复 待解决
HarmonyOS Websocket?
661浏览 • 0回复 待解决
HarmonyOS NodeRender
450浏览 • 1回复 待解决
HarmonyOS TabContent
936浏览 • 1回复 待解决