Harmony问题汇总

  • 395 字

  1. xml中部分控件需要使用全包名,否则findComponentById会查不到

    例如:

    1
    2
    3
    4
    <ohos.agp.components.webengine.WebView
    ohos:id="$+id:webView"
    ohos:height="match_parent"
    ohos:width="match_parent"/>

    如果直接使用

    1
    2
    3
    4
    <WebView
    ohos:id="$+id:webView"
    ohos:height="match_parent"
    ohos:width="match_parent"/>

    会查询不到改控件。

未完待续…

赞助喵
非常感谢您的喜欢!
赞助喵
分享这一刻
让朋友们也来瞅瞅!