feat:iOS implement coordinator plugin
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Group, Panel, List, text, gravity, Color, Stack, LayoutSpec, list, NativeCall, listItem, log, vlayout, Gravity, hlayout, Text, scroller, layoutConfig, image, IView, IVLayout, ScaleType, Image } from "doric";
|
||||
import { Group, Panel, coordinator, text, gravity, Color, Stack, LayoutSpec, list, NativeCall, listItem, log, vlayout, Gravity, hlayout, Text, scroller, layoutConfig, image, IView, IVLayout, ScaleType, Image } from "doric";
|
||||
import { colors, label } from "./utils";
|
||||
import { img_base64 } from "./image_base64";
|
||||
const imageUrl = 'https://img.zcool.cn/community/01e75b5da933daa801209e1ffa4649.jpg@1280w_1l_2o_100sh.jpg'
|
||||
@@ -43,12 +43,15 @@ class ImageDemo extends Panel {
|
||||
label('WebP'),
|
||||
imageView = image({
|
||||
imageUrl: "https://p.upyun.com/demo/webp/webp/jpg-0.webp",
|
||||
loadCallback: (ret) => {
|
||||
if (ret) {
|
||||
imageView.width = ret.width
|
||||
imageView.height = ret.height
|
||||
}
|
||||
}
|
||||
layoutConfig: layoutConfig().just(),
|
||||
width: 200,
|
||||
height: 200,
|
||||
// loadCallback: (ret) => {
|
||||
// if (ret) {
|
||||
// imageView.width = ret.width
|
||||
// imageView.height = ret.height
|
||||
// }
|
||||
// }
|
||||
}),
|
||||
label('ScaleToFill'),
|
||||
image({
|
||||
@@ -110,6 +113,20 @@ class ImageDemo extends Panel {
|
||||
{
|
||||
layoutConfig: layoutConfig().most(),
|
||||
}
|
||||
).in(rootView)
|
||||
).also(it => {
|
||||
coordinator(context).verticalScrolling({
|
||||
scrollable: it,
|
||||
scrollRange: {
|
||||
start: 0,
|
||||
end: 100,
|
||||
},
|
||||
target: "NavBar",
|
||||
changing: {
|
||||
name: "backgroundColor",
|
||||
start: Color.WHITE,
|
||||
end: Color.RED,
|
||||
}
|
||||
})
|
||||
}).in(rootView)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user