[Swift UI] How to disable ScrollsToTop of ScrollView

What is ScrollsToTop

A function that automatically scrolls to the top when you tap the Status Bar (the part where the top time and battery level are displayed) while the Scroll View is displayed.

It is on by default.

How to disable

ʻWrite UIScrollView.appearance (). scrollsToTop = false`.

Example:

ScrollView {
  ...
}.onAppear {
  UIScrollView.appearance().scrollsToTop = false
}


Recommended Posts

[Swift UI] How to disable ScrollsToTop of ScrollView
How to change BackgroundColor etc. of NavigationBar in Swift UI
[Swift UI] How to get the startup status of the application [iOS]
[Swift] How to get the document ID of Firebase
[RuboCop] How to disable warnings
[Swift] How to use UserDefaults
How to use Swift UIScrollView
[Rails] How to disable turbolinks
How to scroll horizontally with ScrollView
How to use setDefaultCloseOperation () of JFrame
[Swift] How to use SwiftLint (cocoapods)
[Swift] How to use Unwind segue
[Swift] How to send a notification
[Swift] How to replace multiple strings
[Swift] How to dynamically change the height of the toolbar on the keyboard
[Swift5] How to get an array and the complement of arrays
[Swift] How to implement the Twitter login function using Firebase UI ①
[Swift] How to implement the Twitter login function using Firebase UI ②
[swift5] How to specify color in hexadecimal
[Swift] Summary of how to remove elements from an array (personal note)
How to name variables 7 selections of discomfort
[java] Summary of how to handle char
Summary of how to write annotation arguments
[Swift] How to fix Label in UIPickerView
[Swift] How to use Tab Bar Controller
How to call Swift 5.3 code from Objective-C
How to determine the number of parallels
[Swift] How to implement the countdown function
[Java] [Maven3] Summary of how to use Maven3
How to sort the List of SelectItem
[Swift5] How to implement standby screen using'PKHUD'
[Swift5] How to create a splash screen
[Swift5] How to implement animation using "lottie-ios"
How to overwrite Firebase data in Swift
[Swift] How to use one option alert
[swift5] How to change the color of TabBar or the color of item of TabBar with code
[Swift] How to get the number of elements in an array (super basic)
[swift] How to control the behavior when the back button of NavigationBar is pressed
How to get the ID of a user authenticated with Firebase in Swift
How to fix a crash when deleting Realm data in Swift UI List
Summary of how to select elements in Selenium
JDBC promises and examples of how to write
How to find the cause of the Ruby error
How to disable user operations during asynchronous processing
[java] Summary of how to handle character strings
[Rails] Introduction of pry-rails ~ How to debug binding.pry
Summary of how to create JSF self-made tags
Customize how to divide the contents of Recyclerview
[Swift] How to implement the LINE login function
Note how to use Swift super basic TableView
[swift5] How to implement the Twitter share function
How to add sound in the app (swift)
[Swift] How to link the app with Firebase
How to get today's day of the week
Output of how to use the slice method
How to use enum (introduction of Japanese notation)
[Swift] How to implement the fade-in / out function
How to use JQuery in js.erb of Rails6
How to display the result of form input
How to execute tasks in parallel in Swift in Swift Package
[Java] How to get the authority of the folder