Why are images in react-native app not rendering after Xcode 12 update - react-native

Not sure what to even document here. I update Xcode to 12.0.1, and out of nowhere, after building and running my application, the images inside the app are not rendering, not counting the splash screen, containing an image, which are built out natively.
These images, whether they're coming from firebase storage (remotely) or whether they're icons (locally) are simply not rendering. no changes in any image code or anything, anywhere in the application. the only change was the Xcode 12 update. and also a macOS update to Catalina 10.15.7
Any ideas on whats going on? let me know If I can provide additional details.

This behavior is a known issue with iOS 14 as you can see here.
You need to change the following file:
react-native/Libraries/Image/RCTUIImageViewAnimated.m
and add the following line:
- (void)displayLayer:(CALayer *)layer
{
if (_currentFrame) {
layer.contentsScale = self.animatedImageScale;
layer.contents = (__bridge id)_currentFrame.CGImage;
} else {
[super displayLayer:layer]; // add else statement with this line here
}
}
Source: https://github.com/facebook/react-native/issues/29279#issuecomment-658244428

Related

ARCore: accessing camera image data from frame.acquireCameraImage

I have an app in Java which needs to get the camera image from ARCore for custom rendering. Recently, two new APIs have been added to ARCore (v1.1.0) which should support this. Well, everything else works for me except these two calls. Both calls are failing with same error (SIGINIT):
SIGINIT
and I have this message in the Logcat:
04-18 14:52:32.007 32623-32623/ A/Ion: [java/com/google/vr/dynamite/client/native/dynamite_client.cc:74] CHECK failed: expression='"env"'
04-18 14:52:32.007 32623-32623/ A/Ion: Dumping stack:
relevant code is:
try
{
// Obtain the current frame from session.
mSession.setCameraTextureName( mTextureId );
Frame frame = mSession.update();
TrackingState trackingState = frame.getCamera().getTrackingState();
if ( trackingState == TrackingState.TRACKING )
{
// Compute lighting, this is also crashing
//final float[] colorCorrectionRgba = new float[4];
//frame.getLightEstimate().getColorCorrection( colorCorrectionRgba, 0 );
//getPixelIntensity works fine
float lightIntensity = frame.getLightEstimate().getPixelIntensity();
Log.d( TAG, " light intensity is " + lightIntensity );
//This is also crashing
android.media.Image image = frame.acquireCameraImage();
//do something useful with the image
image.close();
app level build.gradle has the following entry under dependencies:
implementation 'com.google.ar:core:1.1.0'
and I have tried this with both proguard enabled and disabled.
Can anyone spot what I am doing wrong?
PS: In case it's not clear, the failing calls are frame.acquireCameraImage() and frame.getLightEstimate().getColorCorrection().

iOS Navigation Bar Prefers Large Titles Scroll Behaviour

In iOS 11 the system apps all compress the navigation bar as you scroll down if you enable prefersLargeTitles:
I can't figure out how to implement this in my own apps though, the bar stays the same by default:
The only thing I can see is Hide Bars On Swipe, but that hides the whole bar rather than compressing it:
This is just an empty project created in Xcode 9 beta and with a new storyboard added.
What do I need to do to get the same behaviour as the system apps?
Don't set anything regarding Large Titles in Interface Builder / Storyboard, only in code. That worked for me.
So in the navigation bar in storyboards, Prefers Large Titles unchecked.
In your view controller:
self.navigationController?.navigationBar.prefersLargeTitles = true
It seems like this issue is happening to people for different reasons. None of the above answers helped me, but here's what DID work...
I deconstructed my app to find the cause, which was the view hierarchy in the storyboard. It appears that the UITableView view HAS to the the first view in your view controller. I had a UITableView with two UIImageViews behind it and that's what was causing the issue. Once I removed those UIImageViews everything worked correctly.
My fix: I ended up creating a UIView in code, adding my two image views to that, THEN adding that UIView to the UITableview.backgroundView.
Hope this helps someone.
If you have to target older iOS versions, you’ll also have to wrap the assignment in an availability check:
if #available(iOS 11, *) {
self.navigationController?.navigationBar.prefersLargeTitles = true
}
if #available(iOS 11.0, *) {
navigationController?.navigationBar.prefersLargeTitles = true
navigationController?.navigationBar.topItem?.title = "Hello"
navigationController?.navigationItem.largeTitleDisplayMode = .automatic
let attributes = [
NSAttributedStringKey.foregroundColor : UIColor.red,
]
navigationController?.navigationBar.largeTitleTextAttributes = attributes
} else {
// Fallback on earlier versions
}
http://iosrevisited.blogspot.in/2017/09/navigation-bar-with-large-titles-and.html

Retina Images not being loaded on sencha touch

I've included retina.js in my Sencha Touch application. When watching the network monitor I see
retina.js is loaded
images are loaded normaly example.jpg
no #2x images are loaded example#2x.jpg or even looked for
Using chrome to emulate an iphone this is all I see
I also manually ran Retina.init(window) however nothing happens. All images remain non-retina. Running Retina.isRetina() returns true
I don't actually own a retina device, so I am not sure if that is the issue. However my friend with an iPhone 5s says the image quality has not improved, so I am assuming the retina images are not showing up.
The documentation is not very helpful
I figure this has to do with the fact that images are created and loaded with JS (the images are not there onload)
Using chrome for debugging, how can I make retina.js work for my app?
OK, so I used a small part of the retina.js file and created a new class, it uses the isRetina function to tell weather the devicePixelRatio is higher than 1.
Ext.define('MyApp.Retina', {
singleton: true,
isRetina : function(){
var mediaQuery = "(-webkit-min-device-pixel-ratio: 1.5),\
(min--moz-device-pixel-ratio: 1.5),\
(-o-min-device-pixel-ratio: 3/2),\
(min-resolution: 1.5dppx)";
if (window.devicePixelRatio > 1)
return true;
if (window.matchMedia && window.matchMedia(mediaQuery).matches)
return true;
return false;
},
getSrc: function(url){
return this.isRetina()? [url.slice(0, -4), '#2x', url.slice(-4)].join(''): url;
}
});
Now throughout my sencha app I create images with MyApp.Retina.('http://example.com/foo.jpg') as src value, when the device is retina the function returns http://example.com/foo#2x.jpg

How to programatically find out whether the application is using sencha-touch or extjs 4.1

Here I'm implementing a sample.js file in which designing a floating component.
This sample.js file is independent of any other application. It means when i'm adding this file to sencha-touch project it should show the floating component and if i'm adding this sample.js to ext4.1 project then also it should show the component.
For this i want to know whether the application is using Sencha touch sdk or ext 4.1 sdk?
How can i achieve this?
Any help would be highly appreciated.
We can know whether it's touch or extjs by executing the following condition
if( Ext.versions.touch ){
//write your touch related code here
}else if( Ext.versions.extjs ){
//write your extjs code here
}
Ext.version is documented for Sencha Touch, Ext.versions is not. Alternative to url solution will be:
if(window.Ext) {
if(Ext.version) {
// Touch
}
else {
// Extjs
}
}

keyboard movement when we click on textfield in obj c

hii every one,
In my iphone app i need to scroll the page on click of textfield,actually it was working fine with xcode 3 ,on ios device 3.1.3,when i was using "UIKeyboardBoundsUserInfoKey"
but when i upgraded my xcode 3 to 4,it gave a warning saying that UIKeyboardBoundsUserInfoKey is deprecated u cant use ,so i replaced that API by UIKeyboardFrameBeginUserInfoKey now warning is gone but its not working on ios device 3.1.3,when i click on textfield it ill try to scroll the page but it ill crash,,how can i fix this,,can any one help me,...... thanx in advance
try this:
if (&UIKeyboardFrameBeginUserInfoKey!=nil) {
// use UIKeyboardFrameBeginUserInfoKey
} else {
// use UIKeyboardBoundsUserInfoKey
}