As described in title I'm looking for a way to keep the md-tabs bar fixed at a certain position and having only the single contents available for scrolling. Any hint? Thanks!
Related
I'm trying to have my navigation bar with left and right button (SF Symbols) and title aligned so it looks better visually but text in title view seems to have either some spacing or top alignment there and it makes title look higher which is not what i want. How to make text centered there?
EDIT: Seems it happens when using custom fonts, when i tried system fonts and other custom fonts some of them are displayed correctly
EDIT2: After further investigation it turned out to be the font issue, the one i used is designed not centered, which can be seen even when choosing font from dropdown menu, its not centered in selection either
It's not necessary answer specifically for question in the topic but it is answer for my issue.
It turned out that my problem was caused by custom font which has space below by design. So what i did in the end is to lower navigation title by using this line:
navigationController?.navigationBar.setTitleVerticalPositionAdjustment(CGFloat(5), for: UIBarMetrics.default)
Our UITabBar is cutting off the bottom of our WKWebView text.
Our Storyboard view has a few labels at the top of the screen and a WKWebView set below those labels programatically. It works great but you can't scroll to the end of the WKWebView to see the last line of the text.
I believe this doesn't happen with UIWebView but that API is deprecated.
I understood automaticallyAdjustsScrollViewInsets to be the solution but apparently that doesn't work in this case.
Have tried setting Extend Edges \ Under Bottom Bars to false on the Storyboard. This comes close to solving the issue - the scrolling issue is resolved. Only issue is the Tab Bar then changes color to a darker color and I can't seem to get that to revert to the default lighter grey metallic color.
What is the correct way to do this?
WKWebView contains UIScrollView. UIScollView has contentInset property.
https://developer.apple.com/reference/uikit/uiscrollview/1619406-contentinset
Use this property to add to the scrolling area around the content. The unit of size is points. The default value is UIEdgeInsetsZero.
Figured it out based on some other SO posts:
webView.scrollView.contentInset = UIEdgeInsetsMake(0.0, 0.0, controller.tabBarController!.tabBar.frame.height, 0.0)
... maybe there is a better way (?) but this worked.
I have a site with a fixed header and slide-out sidebars. With iOS7 in portrait orientation, the fixed header stays fixed when the sidebar is visible, but on iOS8 the header pushes slightly upward depending on how far down you are scrolled. I need it to stay fixed.
See this jsbin: http://jsbin.com/xuyevi/2/
The main pieces are a header, a sidebar, and the main content. The header is fixed to the top of the screen using fixed position and has a z-index that keeps it above the content when you are scrolling.
The sidebar is fixed to the left side of the screen, and is initially hidden by being translated left by its own width.
To open the sidebar, each of the header, content, and sidebars are translated to the right by the width of the sidebar.
Again, this works perfectly on iOS7 and all other browsers that support translate3d, and it even works correctly in iOS8 when in landscape orientation. But in iOS8 in portrait, the fixed header will slide off the screen based on how far down the user is scrolled.
Further, using the Safari inspector shows that the menu items on screen are offset from their expected positions. I.e. selecting an element in the inspector highlights an area on the screen that is offset from the actual location where it's rendered.
Has anyone else run into this? Anyone know a fix?
EDIT: The inspector thinks that the fixed position header is exactly where it should be, even though it's actually getting pushed off screen.
A little late to the party, but adding
html, body {
overflow-x: hidden;
overflow-y: scroll;
}
Will fix the offset scrolling on fixed elements that are offset (eg. left:20px) in iOS 8.
I had a similar issue on iOS using multiple fixed position elements and a CSS animated off-canvas nav. On a long page the upward "drift" was a blocker because it eventually increased to the point where it hid the nav trigger, making it impossible to close the menu. I tried extensively to find a fix and settled on a workaround: scroll back to top before animating. (#ocnTrigger is my off-canvas menu trigger.)
$('#ocnTrigger').click(function(){
$('body').animate({
scrollTop: 0
}, 0);
});
I was trying to do something similar (see here and here) then found that Apple has published a technical note recommending that fixed positioning be avoided. I swear it worked fine in iOS 7, but now with iOS8 it no longer "sticks".
This problem seems closely related to setting this meta tag:
<meta name="viewport" content="width=device-width">
See also: Fix div to bottom without using css position
I have a hybrid iOS app that is essentially a uiwebview that loads HTML from our server. There's a fixed position top bar, a fixed position bottom tab bar, and a scrollable/draggable middle content section with content loaded via AJAX. However, sometimes a one-pixel, gray (#838383) line appears at the bottom of the middle content section when you scroll past the bounds of the content, ie, elastic scrolling. However, it's not consistent. In some tabs of the app, it doesn't show up at all, and I can't figure out what's causing it to appear or in some cases not appear. I've searched all the server-side CSS and HTML for "838383" but nothing turned up.
Normal state:
normal state http://msr-cf.matt.re/lio-app-line3.jpg
Elastic scrolling shows gray line:
scrolling with gray line http://msr-cf.matt.re/lio-app-line.jpg
Elastic scrolling on different page does not have gray line:
scrolling on a different tab does not have gray line http://msr-cf.matt.re/lio-app-line2.jpg
Has anyone experienced this before, know why it's happening, or have a solution?
This may slow down rendering a bit, but try the following:
webviewView.opaque = NO
You have to adjust UIWebView: set opaque NO and clear background color simultaneously:
With iOS 7 we get the fancy transparent/blurry status and navigation bars.
I saw many posts here on SO talking about the content being overlapped by the status bar.
I understand why this is happening and it's ok in my case.
Now, I was wondering since I don't have navigation bars in my app:
How shall I handle any content being scrolled behind the transparent status bar.
(Note: By scrolling I mean real scrolling through content)
In my opinion it doesn't look nice if the status bar simply overlaps the content.
Is there an easy way to make it look "nicer"? Or do I have to play with offsets and manual blur to achieve a better look?
If I have understood the question, could you not place the background image to cover the entire screen and offset the scroll view y position by 20px (the height of the status bar).
Therefore you still get the nice effect of the transparent status bar but no content ever going under the bar itself.