feat:optimize iOS Transform setting

This commit is contained in:
pengfei.zhou
2020-03-03 14:43:49 +08:00
committed by osborn
parent 35e9f05114
commit 0fa121e54f
10 changed files with 42 additions and 5 deletions

View File

@@ -139,6 +139,7 @@ class MovieVM extends ViewModel<MovieModel, MovieVH>{
this.updateState(state => state.doubanModel = JSON.parse(ret.data) as DoubanModel)
})
}
onBind(state: MovieModel, vh: MovieVH) {
if (state.doubanModel) {
vh.title.text = state.doubanModel.title
@@ -162,7 +163,7 @@ class MovieVM extends ViewModel<MovieModel, MovieVH>{
}
v.getLocationOnScreen(context).then(ret => {
const centerX = ret.x + v.width / 2;
vh.scrolled.scrollBy(context, { x: centerX - Environment.screenWidth / 2, y: 0 })
vh.scrolled.scrollBy(context, { x: centerX - Environment.screenWidth / 2, y: 0 }, true)
})
},
})