If I have an "old" app with a NavBar and build it with iOS7, the StatusBar is visible together with the NavBar and it looks like a mess! And if I have a flip view (TransitionStyleFlipHorizontal), that TopBar is placed below the StatusBar and when turning back the view the window jumps up in an ugly way to cover the StausBar again. Do I have to reconstruct everything from scratch to make it look good. Just to make the StausBar stay on top of the NavBar? It must a simple way to fix that but how?
Write below code in your .m file.
It basically help you to change location of navigation bar.
-(void) viewDidLayoutSubviews
{
CGRect tmpFram = self.navigationController.navigationBar.frame;
tmpFram.origin.y += 20;
self.navigationController.navigationBar.frame = tmpFram;
}
Related
In react native, devices with virtual navigation keys do not have any problems, while on phones with manual keys (e.g. Samsung A5,) the background and components are behind the bottom bar. When I give flex:1 or height:heightPercentageToDP(100) to my View, I have the same problem. how can i solve it? I'll be happy if you can help me.
i want to components and background start from the top of the bottom bar
You should add your code so it's easier to help you, or even an example screenshot to show your issue... but I will try to answer.
React Native has the Dimensions API which you can import in with your Views and Texts like so:
import { View, Text, Dimensions } from "react-native";
If you grab the height like this: const deviceHeight = Dimensions.get("window").height; using window as the param will give you the height excluding the bar you mentioned. Using screen there would provide the entire height.
You could use the windows Dimension to calculate any margin or padding you might need based on your use case.
I implemented a splash screen last night and this morning I noticed it was taking away my bottom tab navigator. I recreated the problem here
In the snack, originally you will see the bottom tab navigator. If you go into App.js and uncomment the call to the splashscreen, you will see what I am talking about.
Does anyone know how I could go about making sure this does not happen?
The splash screen is a little extra in itself so if you guys think it would be best to scratch this one and go for something else I am open to suggestions!
Thank you for anything, I appreciate it more than you know.
The reason you are not seeing the Bottom Tab is because you are not rendering that part of the app anymore. You were simply rendering the <Home/> component inside the SplashScreen, which is not really the bottom tab screen, but a screen that is part of the whole bottom tab.
To make it work, You can do the following,
inside App.js, export your MyTabs function.
export function MyTabs() {
// all the previous stuff
}
Then import it inside SplashScreen like below,
import {MyTabs} from '../App'
Now replace <Home></Home> with <MyTabs/>.
Here's the Snack
Not totally sure if this is a good practice, will have to dig up some docs, But will work for your use case.
When resizing using react-bootstraps navbar collapseOnSelect the hamburger menu works properly but at xs or below xs rather the hamburger menu is dropping down onto a new line below the logo creating a larger block than I would like the navbar to be on phone displays I'd like for it to stay on the same line.
If I understand that right, the problem that you are facing is when the hamburger change it’s behavior for the smaller devices you would like it to stay dripping down directly below it and not taking the whole screen, right?
If I’m right, that’s the usual behavior for bootstrap hamburger. I would say that it will be better to follow this UX due to smaller devices having very different sizes of screens. But if you would like to change it’s normal behavior you could remove the following css class from your navbar
.collapse.navbar-collapse
I want to prevent the new largeTitles navigationBar from collapsing into a standard small navigationBar when the user scrolls content. i.e. always keep the navigationBar large size with title in large font.
The reason I want to do this is that I have a segmentedControl in the navigationBar above the title exactly like in the iOS phone missed calls page. Except that I always want the title and segmented control to appear. I don't want the title to disappear when the user scrolls.
Is there any default behavior that can keep the new large navigationBar from collapsing when the user scrolls?
Maybe a little late but it might be useful to somebody:
If you add a scrollView (tableView, collectionView) directly to your viewControllers view, the large title will expand and collapse.
If you add any other non-scrolling view before adding the scrollView, the largeTitle will stay expanded.
i ended up doing something like
let view = UIView()
view.translatesAutoresizingMaskIntoConstraints = false
self.view.addSubview(view)
view.pinToEdgesOfSuperview()
self.view.addSubview(self.tableView)
self.tableView.pinToEdgesOfSuperview()
Not the most beautiful solution but it will work.
How can I make the paper-drawer-panel element behave like this site?
https://home-assistant.io/demo/
I want to be able to open and close the drawer panel even when the page is large. I also don't want there to be a drop shadow over the page when the drawer is out and the page is large, and I want the drawer to expand into the page and not overlay the "main".
I know about "forceNarrow" but it doesn't acheive what i want because it overlays the rest of the page when the drawer is active and it casts a drop shadow over the "main".
I just tested this on one of my sites with a drawer and, when I set forceNarrow to true and back again, I don't get a backdrop or anything, it is just as in the site you linked.
I am sure you know this, but for someone else stumbling on this the code would look something like this:
var drawer = document.getElementById('drawer');
drawer.forceNarrow = true;
drawer.forceNarrow = false;
Could you link to your site, or post some code here?
Edit: Here is an example