Is there a chance to implement scrolling to the top of a flatlist (or the whole screen) on tap on the status bar?
There is an ios only prop:
onScrollToTop :
Fires when the scroll view scrolls to top after the status bar has been tapped.
scrollsToTop :
When true, the scroll view scrolls to top when the status bar is tapped. The default value is true.
Link :
https://reactnative.dev/docs/scrollview#onscrolltotop
Related
i'm using createMaterialTopTabNavigator with a swipeEnabled set to True to navigate between screens, I have a Screen which contains an horizontal scrollView, the problems is that the scrollView isn't working, since whenever i try to scroll it horizontally the screen just changes to the next one.
I'd like to be able to disable the swipeEnabled when i swipe in the scrollView.
PS: i tried doing it dynamically by passing a variable to the Screen and a method that sets it to false using onTouchStart, but it's slower than the swiping event of the screen so it end up swiping to the next screen before onTouchStart event start.
Is there any way we can set the swipe able area in react-native-swiper? For example, from the mock screen, I would like the screen to be swiped only when the user swipe on the area marked by black border.
PS: The default behaviour is to let the screen swipe from any where in the swiper component.
Mock Screen
I need to SHOW a view when scroll is started and HIDE a view when scroll is stopped.
To detect the scroll movement, there is two ways:
Called when the user begins to drag the scroll view.
onScrollBeginDrag={this.showView}
onScrollEndDrag={this.hideView}
Called when the momentum scroll starts and Ends
onMomentumScrollBegin={this.showView}
onMomentumScrollEnd={this.hideView}
Exptected Behaviour:
If continues scroll is happening, it should not hide the view even onScrollEndDrag is called and still show the view until onMomentumScrollEnd.
If continues scroll is not active, its should hide when onScrollEndDrag called
Actual Behaviour:
If continues scroll is happening, its hide the view when onScrollEndDrag is called and shows the view again until onMomentumScrollEnd. So in between view is disappeared and then its appears when drag released.
Call a debounced function in onScroll.
Debouncing will mean it is called at the end (or start) of a bunch of
events. More Info
// Debounce
this.ViewVisibility = lodash.debounce(this.ViewVisibility, 100);
onScroll={() => {
this.ViewVisibility();
}}
ViewVisibility = () => {
console.log('Debouncing');
this.hideView();
}
Hi can anyone here show me how to scroll to end on webview ?
When I go to term and condition, I want add button to scroll to the last webview page
I have a back button (using TouchableOpacity) in the top left of my screen. I want to allow its hit area to extend up into the status bar as that's what other apps seem to do and it's easy to accidentally hit the button a little too high touching the status bar just above instead and making the app feel unresponsive.
I've got it's area to extend up behind the status bar but the status bar still seems to grab touch events. Is there a way of making it not do that (at least on the left hand side, I'd still like the "touch to go to top" stuff to work when you touch it elsewhere)?
The UINavigationBar is a UIWindow (not a UIView), which is above the UIWindow you are acting in. Thus it is not possible to present UIViews from your UIWindow.
What you can do is to add transparent UIBarButtonItem additionally to your button, triggering the same action:
var button = UIBarButtonItem(title: "", style: .Plain, target: action: #selector(yourAction(_:)))
button.tintColor = UIColor.clear
navigationController?.navigationItem.leftBarButtonItem = button