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 如何扩大组件点击区域
848浏览 • 1回复 待解决
HarmonyOS jsbridge HarmonyOS版本
405浏览 • 1回复 待解决
HarmonyOS HarmonyOS社区组件问题
724浏览 • 1回复 待解决
HarmonyOS JsBridge的HarmonyOS版本sdk
442浏览 • 1回复 待解决
HarmonyOS HarmonyOS签名验签问题
448浏览 • 1回复 待解决
HarmonyOS
230浏览 • 1回复 待解决
HarmonyOS 关于HarmonyOS应用的备案
316浏览 • 1回复 待解决
HarmonyOS flutter接入HarmonyOS原生视图
558浏览 • 1回复 待解决
HarmonyOS react-native-screens HarmonyOS计划
357浏览 • 1回复 待解决
HarmonyOS NodeRender
190浏览 • 1回复 待解决
HarmonyOS TabContent
655浏览 • 1回复 待解决
HarmonyOS bouncycastle
184浏览 • 1回复 待解决
HarmonyOS gesture
238浏览 • 1回复 待解决
HarmonyOS readPixelsToBuffer
180浏览 • 1回复 待解决
HarmonyOS Websocket?
326浏览 • 0回复 待解决
HarmonyOS onAreaChange
178浏览 • 1回复 待解决
HarmonyOS DatePicker
344浏览 • 1回复 待解决
HarmonyOS HarmonyOS的视频流和操作流
480浏览 • 1回复 待解决