From 2963e490aee0c3c4a7d8037cd113fb5fc8250fe0 Mon Sep 17 00:00:00 2001 From: shutao Date: Wed, 31 Jul 2024 12:22:43 +0800 Subject: [PATCH] =?UTF-8?q?update=20unielement.md=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/dom/unielement.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/dom/unielement.md b/docs/dom/unielement.md index 7f24dfd0..b9c1f572 100644 --- a/docs/dom/unielement.md +++ b/docs/dom/unielement.md @@ -134,6 +134,10 @@ if(element != null) { const view = element.getAndroidView() } ``` + +**注意事项:** + ++ 安卓平台获取的原生View尽可能的避免设置View的background属性,会导致元素background、border、boxshadow css效果失效或设置的background失效,与设置background时机有关。 @@ -158,7 +162,7 @@ if(webViewElement != null) { } ``` -#### 可通过getAndroidView泛型明确定义View类型的组件 +**可通过getAndroidView泛型明确定义View类型的组件:** | 组件 | 对应 android 平台原生View | | --------- | -------------------------------- | @@ -166,6 +170,10 @@ if(webViewElement != null) { | [input](https://doc.dcloud.net.cn/uni-app-x/component/input.html) | [AppCompatEditText](https://developer.android.google.cn/reference/kotlin/androidx/appcompat/widget/AppCompatEditText) | | [textarea](https://doc.dcloud.net.cn/uni-app-x/component/textarea.html) | [AppCompatEditText](https://developer.android.google.cn/reference/kotlin/androidx/appcompat/widget/AppCompatEditText) | | [web-view](https://doc.dcloud.net.cn/uni-app-x/component/web-view.html) | [WebView](https://developer.android.google.cn/reference/android/webkit/WebView) | + +**注意事项:** + ++ 安卓平台获取的原生View尽可能的避免设置View的background属性,会导致元素background、border、boxshadow 失效或你设置的background失效,与设置background时机有关。 -- GitLab