0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

複数のScrollViewを表示しつつStatusBarのTapで移動

Posted at

問題

FacebookライクなメニューUIを利用したりして
ScrollViewやTableViewを複数表示すると
StatusBarのTapで一番上に移動する動作が行えなくなってしまう

対象となるUIはTableView、ScrollView、WebView、TextAreaの4つ

解決方法

scrollsToTopプロパティで制御する
defaultはtrueになっていて、trueのUIが2つ以上あるとダメみたい
どれか一つだけtrueになるようにしておけばStatusBarのTapが動作する

FacebookライクなメニューUIのときは、メニューの開閉に応じて
メニュー側のscrollsToTopをfalseにして
メイン画面のscrollsToTopをtrueにする感じ

いちいち全部falseにするのも面倒なのでapp.tssでdefaultでfalseにしておき
必要に応じてtrueにすると楽

app.tss

"TableView": {
	scrollsToTop: false
},

"TextArea": {
	scrollsToTop: false
},

"WebView": {
	scrollsToTop: false
},

"ScrollView": {
	scrollsToTop: false
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?