提交 763bf3ac 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

Update uts-plugin.md

上级 64695bd9
...@@ -1467,25 +1467,13 @@ let longVal = 1000.0.toLong() ...@@ -1467,25 +1467,13 @@ let longVal = 1000.0.toLong()
### 匿名内部类 ### 匿名内部类
UTS目前还不支持匿名内部类的写法,在android中类似这样的场景
```kotlin
getUniActivity()!!.runOnUiThread(Runnable(){
// do something
});
```
需要声明一个实现类,再新建实例的方式实现,代码如下
```js ```js
class AddUIRunnable extends Runnable { const runnable = new (class implements Runnable {
override run():void { override run() {
// do something
} }
}; })
let uiRunable = new AddUIRunnable(); getUniActivity()!.runOnUiThread(runnable)
getUniActivity()!.runOnUiThread(uiRunable)
``` ```
### 泛型参数 ### 泛型参数
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册