Scrolling a tableview inside a popover creates an artifact - ios

If you look at the button/label titled "Address" you'll notice a little speck of white in the corner. This speck of white only occurs when the user starts scrolling the tableView, which is located underneath the searchbar.
I can only guess that the modal border kills all transparencies while scrolling.

This is an iOS issue with regards to scroll view and is seen in many places - no solution other than you reducing or creating some offset for the tableview.

this artifact could be caused by a variety of different things. The first things I would check when seeing these things is that all of the UIViews (and there subviews) that overlap this area
A. Have a background color with an alpha value of 0
B. Have "Cear Graphics Context" turned off in Interface Builder (or corresponding flag in code)

Related

How to minimize visual flickering with iOS8 "UIVisualEffectView with Blur"

I have a particular app that, because of the navigation structure, leaves me unable to use normal UINavigationBars with translucency, so I've chosen to try and use iOS8's UIVisualEffectView with Blur.
This solution mostly works, but there is a very noticeable flickering effect that occurs when the UITableView beneath this blur view is scrolled around. As the edges of an image or colored rect pass underneath the blur view, there is a significant amount of flickering that occurs.
Has anyone experienced this? Anyone know how to solve this problem?
My implementation is simple, I dragged a UIVisualEffectView onto my view controller and constrained it to top, left, and right screen bounds, and added a height constraint of 64. Beneath that is just a UITableView with some images and text.
"I assume that what’s not under the view is not being taken into account to compute the blur. It is likely being extrapolated (by padding the image by mirroring, replicating, wrapping, etc… as you would do to minimize boundary effects on any convolution). But this creates an undesired visual jump in many cases.
If you want to minimize this artifact, just make the
UIVisualEffectView bigger than your view. A few pixels will suffice,
the blurring kernel is not that big anyway. And make your view to clip
to bounds."
Reference: https://medium.com/#imho_ios/avoid-artifacts-on-uiblureffect-edges-c30e737c21fb
This worked for me, at least eliminated the bottom flickering in the Navigation Bar. However, it did not work at the top. I believe that is due to view (maybe UIWindow?) clipping against - in my case - the tableView.
UPDATE:
It seems the bug are fixed in iOS 9.0 and later.
I make an uiview which alpha is 0 and add blurview as subview of that. So i can minimize that flickering problem also can hide/show or rounding corners it with animation.

I've added a view within a UITableView and there is a gap between the view and the first cell. How can I remove it?

I've added a view to a tableView and there is a gap between the view which is 44px high and the first cell.
Here's a screen shot from IB:
I've tried a few things such as changing the heightForHeaderInSection's value and also disabled adjust scroll view insets. None of these work properly. The view seems to be within the tableView and scrolls with it.
This is how things are looking in simulator:
Would appreciate some help here as I don't understand what exactly is causing this gap.
Thanks for your time
A great way to debug these types of problems is to set a background color. You could set the cells to red and the view to green. It would then be interesting to see if the red and green edges are flush with no white in between.
Based on your screenshot, it looks like nothing is wrong. And by that I mean it looks about right for a view height of 44 points and a cell immediately beneath it with no separator line above it (so it's hard to tell where one ends and the other begins).

moving image behind label

I have an image on my view, which I add programmatically & and not through storyboards. The image gets animated to move up the screen. At one point it crosses paths with several buttons and labels, which contain important text that gets blocked by the image passing over them. I want the image to move under the labels and buttons so that the text remains visible. Based on this answer IPhone Interface Builder: Z-Index, Z-order of a button, image, ui element, etc?, I tried to use editor => arrange => sendToBack/sendToFront, however, I don't think this is having any effect because the image doesn't appear in the tree of elements in the storyboard. As noted, it gets added programmatically at a certain time. Is there a way to do this?
I believe you can use [view insertSubview:imageView atIndex:0] which will place it behind all other subviews. Depending on what other subviews you have, you may need to increase the index as it controls what is placed over what in the view (lower index will go behind higher index)
As in answer to this question: Difference between addSubview and insertSubview in UIView class
If you're using addSubview:, your view will be placed on top. To control it's depth use either insertSubview:atIndex: (at exact place from bottom) or insertSubview:aboveSubview: or insertSubview:belowSubview: (which places new view above/below another known object in view hierarchy).

Weird UIView rendering issue

I'm facing a really weird problem with a UIView (as seen in the attached screenshot).
Basically there is a UIView with a backgroundColor that has an alpha of 0.9 (the dark blue area). Within that view there is some text, and another UIView (the circle). I've got an NSTimer that runs every second to count down that middle number (16), however for some reason, after about 3 seconds the dark blue area becomes 100% transparent (only in certain areas, e.g. the light blue with dots, and the 'records' section) and shows the UI elements in a completely different view. If I remove the alpha transparency on the backgroundColor, everything continues to render correctly and this issue doesn't occur.
Any suggestions? I've tried forcing it to redraw the UIView, tried adding another UIView and setting the background of that as well.
EDIT: It's also occurring with a 3rd party library not written by me (the alert window).
Add an assert in your timer handling method to insure you are on the main thread when you deal with the UI (see NSThread).
Also why are you adding views to the key window and not to your root view? The system moves windows in the Z plane.

UITableViewCell incorrect X positions

I've been searching through here and googling like crazy for a possible solution to this problem. Thus far I'm turning up exactly nothing that actually fixes it so I'm hoping someone can help.
I'm working on the UI for a iPad app. I'm doing it using interface builder. I worked with storyboards briefly but I don't like them all that much so I'm sticking with IB for now. Unfortunately I'm not very experienced with the workings of IOS Ui but it's been going relatively smoothly so far. In my app, I have a view controller, which holds a view containing a pair of sub views. One subview contains a rather windows like header bar (i like the look). The second contains a UITableView. The UITableView is set up properly as far as I can tell, and feeds it's info from a data source using custom UITableViewCells. The UITableView is set to grouped though currently there is only one section. The table is in edit mode by default because I want the user to be able to add new items and use the VC as a selection dialog. The view controller is presented (rather than pushed) using UIModalPresentationFormSheet (again, because I like the view) but I don't know that has any bearing on the problem. The cell border is flush with the X origin, the only reason the text isn't currently starting there is because I went into my cell and move the label over, leaving a gap between the edge of the cell and the label containing my text.
The Offending View http://bit.ly/144cbjT
The Problem: The UITableViewCells, for some reason are positioning themselves at X: 0. This puts them outside the border drawn on the UITablewView when you set it to grouped style. I could probably just turn off the border and get away with it, but I like the look so i want to keep it. I've tried messing around with constraints and anchor points on the cells, the content of the cells, the table itself, the view... I've tried simply moving my cell's labels over a bit. I've also had clipping subviews turned on and off. I've made sure the controls are being loaded properly from the XIB. I've made sure everything is added as a subview where needed. I've made sure I've tried everything I could think of short of setting the cell's X position in code. But since I'm not sure how to tell where the border is, I'd rather have the tableview or the cell do the work itself.
The question: How do I fix this? The selection accessory should be outside the grouping box. The text should be inside, not bleeding out onto the background like it is.I believe the content of the cell should be displayed inside the border within the yellow area.
The odd thing is, this is my fifth or sixth table in this app and I've been doing them all basically the same. Thus far this is the only one I've had trouble with.
Can anyone shed some light as to what's going on?
Thanks in advance
I think that to get this in code, you'd have to do something explicit, so the most likely candidate is a messed up IB file.
Since it doesn't cost anything, I'd just delete the tableView from the IB and then re-add it. If that doesn't work, try recreating the complete IB.
Hope that helps

Resources