Inaccurate Simulated Metrics for Landscape Navigation Bar - xcode4

It seems that the simulated metrics for a view with a navigation bar are based on the dimensions of the portrait mode navigation bar. When the app is compiled and run, landscape navigation bars are actually slimmer (less high) than they are in portrait mode.
Is there any clean way to fix this other than to programmatically add my navigation bar while putting a slim placeholder nav bar in my XIB, while forgoing simulated metrics? That would be a shame because I like using simulated metrics.

Related

Using Xamarin Forms, maintain aspect ratio of Navigation Page Title Icon in Landscape on iPhone X

When running a Xamarin Forms app that uses a TitleIcon on a Navigation Page, the image is squished when the device is turned to landscape mode. What do I need to do to maintain the aspect ratio of the image as it does with previous devices?
iPhone 8 Portrait:
iPhone 8 Landscape:
iPhone X Portrait:
iPhone X Landscape:
For these kinds of customizations, I think you might be better off avoiding the built in NavigationPage NavigationBar and instead implement your own navigationbar in XAML. It would be relatively simple to just use a grid or absolutelayout with your desired background color and image and place it at the top of your pages. You could use a control template or a reusable content view to avoid copying and pasting the bar to every page. Once you've got that done you just have to hide the default navigationbar by using
NavigationPage.SetHasNavigationBar(myPage, false);
Or by adding this to the top of your content page definition in XAML
NavigationPage.HasBackButton="False"
Something like this might help you get started:
http://lukealderton.com/blog/posts/2017/january/replacing-the-xamarin-headernavigation-bar-with-a-custom-viewtemplate/

CSS/JS to imitate multiple mobile app screens: left-to-right orientation, one-at-a-time behavior

I am working on a Flask / Vue.js web app that I want to have work well with both laptop and mobile browsers. The layout I've chosen is to have a series of mobile-screen-shaped areas that are oriented in a left-to-right fashion when viewed on a laptop browser. Currently when viewed on mobile those mobile-screen-sized areas get shifted into a top-to-bottom orientation, and the user can scroll the screen up and down to go through them all.
What I'd like to do is to have the mobile CSS instead simulate a mobile app by having those cards(?) oriented left-to-right (like the laptop view), and have a swipe shift each one into view or out of view, but always snapping to a single card at a time, rather than displaying 1/4th of the first card and 3/4ths of the second card (for example).
Current laptop browser view:
Desired mobile behavior:

How to disable zooming ability on mobile for a particular element?

I have a top menu bar and when is on mobile if I try to zoom my website then my menu bar is zooming as well. I don't want to zoom the menu bar
You could globally disable zooming, capture the zoom gestures in Javascript and rescale the rest of your website accordingly.

customizing bootstrap columns in portrait orientation for mobile devices

Task: Trying to make a mobile webpage: http://jsfiddle.net/anujbhai/hgaH7/3/ (also include jQuery & Bootstrap files in order to run properly).
Problem: Page should change layout according to Orientation - in landscape mode
<div id="videoThumbs">...</div>
will show 2 thumbnails and snaps beneath the
<div id="billboard">...</div>
while in the portrait mode the latter goes to the left of the screen and the former now shows only one thumbnail, appearing like a sidebar.
This is very hard to do with just mediaqueries and Bootstrap. I can't figure out a proper logic to be applied via JavaScript. Please help.
You can try using the default Bootstrap responsive utility classes.
Take a look at the documentation:
http://getbootstrap.com/css/#responsive-utilities-classes
http://getbootstrap.com/css/#grid-options
Small and Extra small devices classes can work for portrait tablet view and Small and Medium devices classes can works for landscape mode, you need to try various combinations.
Obviously, depends on the screen size of the tablet, but this works excellent in 7" and 9" tablets.

What's the technical definition of this CSS behavior?

Go to the following Foundation CSS framework documentation url:
http://foundation.zurb.com/docs/navigation.php
In the section named Nav Bar you will see an example for horizontal navigation bar. Now try to gradually minimize the browser's window, when the window is minimized enough (to be like mobile devices resolution) you will notice that horizontal navigation bar is turned into vertical navigation bar. I need to know the technical definition for this behavior occurred to the menu.
I believe you are looking for responsive web design; which is design that adapts based on the user agent's viewport.
Twitter's bootstrap framework for example, has responsive design built-in.
I've reproduced that effect using width: auto; float:left for each menu item, and on resize event I'm checking if all the items are aligned at their top. If the items are not aligned, I'm modifying to width:100%
here is an example of what I got: www.gabitzish.com (see menu)

Resources