Animated doesn't work after setState is called - animation

Description
I want to perform some change before animation start, so I called setState() before Animated.spring().start(), I expected the component is updated first then animated, but the animation isn't started at all. Is this a bug? If not, how should I do?
Reproduction
Here's sample code:
this.setState({zIndexLeft: 0, zIndexRight: 1});
Animated.spring(this.state.contentPositionRight, {toValue: 200}).start((finished) => {
this.setState({actionsheetState: -1})
});
Additional Information
React Native version:0.42.3
Platform: iOS
Development Operating System: MacOS 10.12.4
Dev tools:Xcode 8.3, iOS 10.3

Related

iOS simulator scrolling action too fast

After upgrading flutter 3.7.0 yesterday, my iOS Simulator's scrolling speed changed to fast. Every single scrollable speed changed significantly. I don't want to downgrade flutter version, because when I create new flutter file and start iOS Simultator, it works fine. So I think it is not a flutter version problem. How could I do?

Working with appcelerator titanium ti.coremotion on ios 8+

I am trying to develop a stepcounter using the ti.coremotion module.
I am trying to implement http://docs.appcelerator.com/platform/latest/#!/api/Modules.CoreMotion on devices with ios 8 and 9, but as it says in the doc, this only works for ios 7. I am stuck now. I tried running it on a device with ios8 and it said "Device does not supports step counting".
I tried searching it on google and got this: https://github.com/benbahrenburg/Ti.CoreMotion
which says it is for ios 7+ but works with sdk 3.2 only. What I am working with is sdk 4.1 and I need it as 3.2 will not work for other things.
Any help is appreciated.
I just build an app with SDK 5.0.2.GA to my iPhone 6S running iOS 9.1 and this sample code and it worked fine:
var CoreMotion = require("ti.coremotion");
// This code checks to see if the device can gather step counting data
if (CoreMotion.isStepCountingAvailable()) {
// If it can, it starts the step counter and outputs the data to the console
CoreMotion.startStepCountingUpdates({stepCounts: 1}, function(e){
Ti.API.error(JSON.stringify(e.numberOfSteps));
});
} else {
Ti.API.error('This device does not support counting steps.');
}
What device are you testing on? Does it work for you on a device running iOS 9?
If you have reproducible code/steps/environment then please create a JIRA ticket: http://jira.appcelerator.org

Cordova window.openDatabase() on Xcode - no error output

I have a Cordova iOS app that makes a call to window.openDatabase() in the onDeviceReady() event handler. It seems execution of the onDeviceReady() event handler stops on that line, because my console.log() beneath that line never show up in the debug console in Xcode. Neither do any other error messages.
The same code works fine on Android devices and Chrome/Ripple emulator. What is wrong?
var db = null;
// PhoneGap is ready
function onDeviceReady() {
console.log("onDeviceReady");
db = window.openDatabase("mydb", "1.0", "My DB", 100000000);
console.log("This will never be displayed in Xcode log");
db.transaction(checkDB, checkErrorCB);
}
Cordova version: 2.3.0
Xcode version: 4.5.2
I am testing on iPhone 5.1 and iPhone 6.0 simulator.
Doh!!
Seems the DB size I specified was to big, it all started working when I removed a zero... That's the kind of thing that's easy to overlook when you've been looking at the same code for weeks and it's been working fine. I just picked a random large number "to be on the safe side".
This code is working:
db = window.openDatabase("mydb", "1.0", "My DB", 10000000);

Custom input view does not work anymore in the iPhone iOS 6 simulator

I have made an app, which has a custom input view, it works fine on the ios 4.3.3 and ios 5.1.1 as well as the new ios 6 if compiled using xcode 4.3 with the base SDK 4 but after updating xcode to the latest version and compiling using the ios 6 sdk the input view does not work anymore. if input button are taped the text doesn't show in the textField. Does anyone encounter this problem or now its cause ?
Make sure that you are initializing your custom input view with a frame that has a width or height larger than zero. From what I can tell, if this isn't the case then iOS 6 doesn't even add the view to the view hierarchy.
In my case, the width of my keyboard view's frame was zero when calling initWithFrame:(CGRect). Everything worked fine in iOS 5, as the frame width would get set during layout, but in iOS 6 the keyboard wasn't even in the view hierarchy.
I used iOS Hierarchy Viewer to figure that last bit out with having to fiddle in the debugger too much.

Strange white bar shows, when using TTThumbsViewController with iOS 5 SDK

I write an iPhone application using Three20 library to display thumbnail images. At first I build the app using XCode 4.0.2 with iOS SDK 4.3 and I used deployment target 4.2. It did fine, the images appeared normally.
thumbnail image in iOS 4.3 Simulator
Then I upgraded to XCode 4.2 with iOS 5 SDK and ran the app with iOS 5.0 simulator,
there's white bar in there.
thumbnail image in iOS 5.0 simulator
I don't know what is this thing exactly maybe some kind of border or something that I don't know. Any help or clue would be appreciated. Thanks.
Here's what I did to make it work..
Create a subclass of TTThumbsViewController, then do the following:
in ViewDidLoad, include this line
self.tableView.sectionHeaderHeight = 0;
Overwrite - (void)updateTableLayout to the following
-(void)updateTableLayout {
self.tableView.contentInset = UIEdgeInsetsMake(/TTBarsHeight()+/4, 0, 0, 0);
self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(TTBarsHeight(), 0, 0, 0);
}

Resources