How to change background-color of LayoutAnimation? - react-native

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?

Related

React Native ScrollView hover touch event

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

Increase UINavigationBar title font size on scroll

I saw this effect today where the navigation bar title seemingly starts within the view, then shrinks and moves upwards into the navigation bar's title as you scroll the page, it then reverses to its original state when scrolled back to the top.
Does anyone have any insight on how this is done? Is a navigation bar used at all, or is it being mocked using a UIView that shrinks in height and the background colour darkens? Perhaps the title is a label converted to a UIImage and scaled down rather than the font size decreasing?
Just speculating on possible techniques.
Would love to get some opinions on this. Thanks in advance.
Yes, You can change the size of the font and the origin of the Navigation Bar in accordance with your gesture recognizer.
navigationBar.frame.origin.y = -10
will shift the Navigation bar up by 10 points. The font can be changed using
if let font = UIFont(name: "Lato-Light.ttf", size: 34) {
UINavigationBar.appearance().titleTextAttributes = [NSFontAttributeName: font]
}
This format is because using a forced unwrap ! will crash the app with UIFont
In this context, font can be a variable where you call the normal init with same typeface and different size.
These two operations should be performed whenever the gesture recognizer updates its value or scroll position. You may or may not have to redraw the view, however.

How to make a view transparent without transparent subview on that

I have a probem like this. We know we can make transparent an UIView by changing Alpha value of that view. But I dont want to make transparent buttons which are inside that view. My problem is when I set the parent view alpha, button also get transparent and button title not visible clearly. How can I overcome this problem.
Set the background color of the UIView with variable alpha, like this:
view.backgroundColor = [[UIColor white] colorWithAlphaComponent:0.5f];

Resize views when menubar autohides/appear in fullscreen mode

I'm working on an OSX app that supports a fullscreen mode.
The window is generated from a nib file but everything else is handled programmatically.
When I goes in fullscreen mode, my views resize properly but when the menu bar appear/disappear, setFrame don't get called for either the contentView or my own views. I'd to be notified
Is there a delegate to implement to catch those notifications? Or do I have to subclass NSWindow and find out how Safari handles its menu bar by reversing it?
It would be helpful to see some code, how exactly "your views resize properly".
But next info might help:
When a window goes fullscreen it occupies entire screen after the end of the fullscreen animation. The main menu bar shows over the window ("above" in sense of z-ordering). So when main menu bar shows/hides frame of your window and content view don't change.
Also note, that -[NSScreen visibleFrame] returns unoccupied frame. And it will not return whole screen frame until the end of the fullscreen animation.
After some researches, I could at least get ride of the dirty gray bar at the top of the screen by subclassing the window's content view and add the following code to the setFrame method, before call super:
//isFullscreen
if(([self.window styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask)
{
frameRect.size.height = self.window.frame.size.height;
frameRect.size.width = self.window.frame.size.width;
}
The window get resized to the screen size before setFrame get called, so we can use its size to update frameRect to window's size.

fading background while UIWebview has focus

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];