I am working with bootstrap carousel that works perfectly minus the fadeout of the current slide. The fadeout animation just disappears without the animation. This reveals the background until the new slide appears. [it gives the appearance of a flash]... How can I make the fadeout animation work with the new slide. [current slide-out while new slides in]
I am using this snippet on this site
Related
I have a ScrollView and a Footer on absolute position.
When Scroll down the footer is hidden
and
When Scroll up the footer appears.
I want to modify the Scroll up animation.
when Scroll up with 1 touch(the finger doesn't stays on the ScrollView while scrolling) on ScrollView the footer appears.
but
when Scroll up with hover touch(the finger stays on the ScrollView while scrolling) footer remain hidden.
How can achieve this?
EXPO code:
https://snack.expo.dev/#stefanosalexandrou/humiliated-chips
I have a view which can be disappeared by clicking a button. Before I "remove" the View I set this:
LayoutAnimation.easeInEaseOut();
The animation works fine, but the Animation is always fading to white before reducing the height to zero. But the background of the app is black/darkblue.
Is there a way to change the color of this animation?
I have a bug I've been looking at for over two hours and still don't know why it happens.
I have a registration form on a scroller view, which scrolls down if they keyboard is in the way of the textfield (function called at Editing Did Start).
Here's the code segment where the bug happens:
CGPoint scrollerOffset = scroller.contentOffset;
UITextField *currentTextField = sender;
CGPoint textFieldOrigin = currentTextField.frame.origin;
if (scrollerOffset.y < textFieldOrigin.y) {
scrollerOffset.y = textFieldOrigin.y - currentTextField.frame.size.height;
NSLog(#"Offset: %f",scrollerOffset.y);
[scroller setContentOffset:scrollerOffset animated:YES];
}
Now here's where the fun starts.
If I have the simulator like this and click inside the Phone Nr field, NSLog shows 590.000 for scrollerOffset.y and the text field jumps all the way to the top of the scrollview, as it should, just as the image next to it shows.
BUT if I have the simulator like this and click inside the Phone Nr field, NSLog shows 590.000 again but the scrollview doesn't jump up to show the text field...
Edit: If I don't animate the scrolling, it works perfectly, only bugs out when it's animated.
Well I've found the solution after a day of thinking, so if anyone has the same problem, heres's the solution:
Solution from here: http://www.pressingquestion.com/1128098/Disable-Uiscrollview-Scrolling-When-Uitextfield-Becomes-First-Responder
Basically, iOS has an in-built scroller, which is also scrolling for you if the text field is off the screen (usually the center of the text field is off the screen, off the screen being out of view, if it's hidden by the keyboard, it's still considered to be on the screen). So I called my function, did the scrolling, then iOS did his scrolling and messed me up. So you need to disable iOS' in-built scrolling.
Is it possible to fade the background of an app (a lightbox type effect) when a UIWebView has the focus, keeping the UIWebView sharp?
Add another transparent view (to achieve the fading effect) in the superview of the webview:
[self.view addSubview:transparentView];
After that, bring the webview to the front.
[self.view bringSubviewToFront:self.webView];
I need to have my UISCrollView only accept scrolls in one direction, not only one dimension. The ScrollView contains album art for songs in a playlist on a horizontal direction. It is paged, so each cover has its own page. When the user swipes or drags the cover to the left, the next cover slides in place and the next song is played.
It should not be possible to go back to a previous song, or cover. How can i prevent this behavior?
I tried the following:
- (void)scrollViewDidScroll:(UIScrollView *)scrolledView
{
if(scrollView.contentOffset.x < (pageIndex * 320) - 320)
[scrollView setContentOffset:CGPointMake((pageIndex * 320) - 320, 0)];
}
But if i do a quick slide to the "previous" direction, the cover will slide about 150px to the "next" direction, strange.
I have also tried removing the previous covers with removeFromSuperview, but this only leaves a black space, dragging can still be done.
Lastly, i tried to move the covers:
-(void) reloadCoverScrollView{
for(int i = 1; i < [scrollView.subviews count]; i++){
[scrollView exchangeSubviewAtIndex:i withSubviewAtIndex:i - 1];
}
[scrollView setNeedsDisplay];
}
How can i accomplish what i want? The ScrollView should behave as if it was always at the first page. Thanks.
You have two options:
you build your own custom view
you change the scrollview behaviour by moving the current page at offset 0
I explain both solutions:
** CUSTOM VIEW (NO SCROLL VIEW) *
What you need here is a scroll view where most of the useful scroll view features are removed: no continuous scrolling (but pagination), no zoom, limited content size (so you are limited to one page).
In my opinion you should make a view controller where you instantiate two views: one is the current view, the other is the next view; the current view is visible, the next view is placed just outside the window. Then you add a single finger pan gesture and by tracking its status (it is a continuous gesture) you can slide the second view on top of the first; when you consider the swipe complete then you will finish the animation. At the end of the animation you set the new page as "first" and render the hidden second page with the next view, and so on...
** KEEP USING SCROLL VIEW **
In such case your view controller that behaves as UIScrollView delegate must behave in such way that the visible page is placed at content offset zero. So let's say you start at page 0 and you have a list of pages in the scroll view: page 1, page 2, ...
As soon as you swipe to page1 and the animation is finished, you immediately translate all view from page 1 by one page on the left (so if your page is 320px wide you will translate all subviews by 320px on the left) and you will remove the subview at page 0. Then you will reset your scroll view content offset to the origin (0,0). So at the end you will have your new page 1 set at position 0, page 2 moved to position 1 and so on. It will be impossible to scroll left but only right.
When you used "removeFromSuperview" you did the right thing but you forgot to translate the subview and reset the content offset.