Flat list scrollToIndex animation configuration - react-native

Is there a way to modify the (default) animation when using FlatList.scrollToIndex?
I'm using this to have a step-by-step scroll but it feels a bit clunky (slow) with the default animation. I would like to avoid animating the scroll myself if possible. But if that's the only option I would like to ear suggestions.

Related

Making a CustomView with a static vertical size in Cocoa

I'm making a document viewer in Objective-C, I want to have a bar at the top of the page with a bunch of buttons in it which open up menus, change pages, etc. At the moment I'm using a custom view which then just has all of the buttons inside it, but my problem is that it isn't a static vertical height, so when the window resizes it changes the size of the custom view rather than my PDFView. Is there a way I can stop it from resizing, or is there a better method I should be using to create a menu?
Thanks!
With auto layout, you can just give the view a fixed height -- from the editor menu, choose Pin, then Height. Make sure that it then only has one vertical constraint, either to the top, bottom, or centerY.
Are you using Auto-layout ? You may have to play with it.
Without seeing the code it's hard to debug the problem. Post the snippet where you're re-sizing the views if you're not using auto-layout.

Replacing a subview with Core Animation

The animator proxy in Core Animation works pretty good, however the animation can be unclean if you try to animate the frame of a view. The frame rate is pretty bad, that's what I mean.
My view that I animate has a lot of subviews, this is why the animation get's even worse.
I found this tutorial on how to do this with Core Animation:
http://www.cimgf.com/2008/03/03/core-animation-tutorial-wizard-dialog-with-transitions/
However, if you run the example code you'll see that the animation has an opacity animation too, and it looks very odd. So I'd like to make a custom animation.
It would be great if someone could provide me the solution of this problem.
Or give me some proper resources where I can do some research.
I need a ease-in-out animation from the bottom to top and top to bottom.
Like the mail-tableview in Sparrow.

Scroll with pictures

I'm programming on objective-c. How can I create scroll with paging enabled like this.
First check the property of scroll view for Paging enabled.Then set your scroll view content size corresponding to how much page you want.
You can try this implementation
https://github.com/100grams/HGPageScrollView
There's also a nice website for custom cocoa controls http://cocoacontrols.com/, where you can find very good stuff, so you won't need to invent the wheel =)

Optimize Custom Drawables

I'm drawing some custom shapes behind a textview to make it appear it's a notepad. It draws a repeating bitmap across the top, as well as a white background under the text, and a secondary "note" page under the rest to add a little dimension and layering. See the screenshot:
Now, this is with setDrawingCacheEnabled(true) for the TextView this drawable is applied to. With this method call applied, the scrolling is VERY smooth, exactly what I want. Without it, the black background disappears, but the scrolling is very choppy. Any idea on how to cache this view so that scrolling is smooth without destroying my UI?
Seems this function only works with solid colors, as defined in the documentation which I should have read before posting. I find it hard to believe there's nothing that caches complex views and drawables to work as well as that function does, but, whatevs. Live 'n learn.

A UITabBar like this

I wondering how I can make a UITabBat like this:
The height of this is more than the stand UITabBar and also the icons are larger. Also the arrow on top.
I tried changing the height but it looks really bad. The icons aren't centred vertically. Also I couldn't change the background.
Thanks.
I'd suggest several things;
Check out the core animation videos from this years wwdc, you can use it to create effects like the triangle and move it back and forth. Then write your own tab bar controller class.
you could also consider a third party library like http://cocoacontrols.com/platforms/ios/controls/tabbarkit