UIDatePicker Cutting Off Text & Not Displaying Days - ios

My app is suddenly unable to correctly display UIDatePickers. I'm using storyboards. The Datepickers are set to just display the date. They are cutting off the month, and also not even showing the days. There's a big space in the middle. I have tried cleaning the project, resetting the simulator, checking localization settings, and checking to see if dynamic type size was set. I'm using Xcode 5.1.1 but the same thing happens in the beta of Xcode 6. Any suggestions would be appreciated.

Ok, I figured it out. This happened as a result of trying to use UIAppearance on a tableView background color. This has nothing to do with tableViews on the face of it, but Apple must be using a tableView privately for the PickerViews. So, my attempt to set a UIAppearance via a category on a tableView background color seems to be doing something unexpected. Lesson learned. Don't try to use UIAppearance where they are not officially supported.

I had this exact same issue, and it was related to duplicate constraints in my storyboard. I'd been implementing iPhone 6 widths and inadvertently ended up with both width = 320 and width >= 320. Removing that width = 320 fixed it instantly.

Related

Why autolayout is very inconsistent sometimes

I had a view controller and some textviews and I am setting the textviews height dynamically using height constraint constant I set the the problem of inconsistency came at setting the height for two textviews...
One day I set its height for different devices(iPhone 4s,iPhone 5s,iphone 6s, iphone6s plus) and it was working fine for these devices but.. next day it wasn't working then I had to set the height constants again..
I am wondering how come this could happen ? why it worked previous day and why I had to change again ?
its very confusing this particular incident made me lose confidence on autolayout in xamarin.ios itself ?
Earlier some thing like this happened for one of the view's top constraint..
Please somebody tell me if there are any other things I have to be aware when it comes to autolayout in xamarin.ios ...
Please somebody clarify
Maybe first time you tested your app "AutoLayout" was enabled in storyboard, but at second time it was disabled.
Please check the link below and check the paragraph about enabling/disabling the "AutoLayout" property.

Navigation controller causing auto-layout issues on screens in Xcode 8

This has happened on a couple of apps I've been working on, and I believe it has something to do with Navigation bars or Tab bars. I'll work on another screen and be messing with the code and then I'll randomly scroll across the Storyboard and see that all the constraints have suddenly changed values and some items have expanded to 1000 x 1000.
Has anyone experienced this before, and know what is causing it? It's happened quite a few times to me now and it's obviously annoying to reset them each time.
Since you updated your Xcode to 8, you may need to update frames in the whole scene (once).
If you do that each time and it doesn't help, for me changing size of the storyboard helped. For example change from iPhone SE to iPhone 6 and vice-versa.
Now in Xcode 8.1 Beta version, there is a shortcut button for this.
Just select the problematic view's superview (containing mentioned constraints), and click this update frames button:

UICollectionView flickers thin "see through" lines between cells when scrolling

I have a UICollectionView with cells that are filled with a background image. The collection view has line spacing = 0.
This has been working perfectly well on iOS 6.1, but when tested on the iPhone 6 with iOS 8.1.3 I see thin "see through" lines appearing spontaneously between cells on collection view load, and then they are jumping around when scrolling.
So, how do I get rid of these lines?
I found a solution: make sure that all cells have "Clip subviews" unchecked. I guess this must be a bug, as the solution doesn't make sense, but it solved the problem.
EDIT* - This is actually caused by the app's deployment target being set as iOS7. When I switch to ios8, the problem goes away.
Sounds like you need to update your app to properly support iPhone 6/6+ screen sizes. One of my apps has this problem.
You'll need to go to your project settings and set a launch screen file so that it knows to show your app at actual size on the iphone 6/6+; otherwise, it will just show a scaled view of what one sees on the iPhone 5s.
I'm assuming this happens because the scaling from iphone5 to 6/6+ isn't exactly 1:1 pixel ratio. For example, because of imperfect scaling, a line at y:50 might be 1 pixel tall, but at y:51 it might be 2 pixels tall, which when scrolling causes a noticeable flicker.
I had the same problem, but it also happened on iPhone 4 with iOS7 (not only on iPhone 6 with iOS8.1). "See through" lines appeared between my section header and between the cells, some of them were permanent, others could just blink or disappear when I scrolled the view.
I could solve it expanding the background of my section header and cells by two pixels (in the bottom) and setting both views to not clip its subviews, as Lukas Kalinski suggested. Disabling clipping alone didn't work.
This worked for me, but it's kind of a hack. Not sure why iOS is presenting this behavior. I feel like we're still missing something.
I didn't try the suggested answer because I need to support iOS6+ and I can't stop using the iPhone 6 scale mode.
Check if the width and height of your collection view is an exact multiple of the widths and heights of your cells.

UIImageview not showing image in whole app in device

I am facing one serious issue in my app regarding UIImageview. It's not displaying images if i set from using UIImageView in xib but if i set it through code then it's getting displayed. And this issue is coming in Xcode 5.1.1 or above version of Xcode and in device. In simulator it's displaying all images perfectly.
Please help me solving this issue.
Any help will be appreciated.
Thanks.
hope this will help
if your image is shown in simulator(in all the condition through .xib or programmatically) and not in device , it might due to of case-sensitiveness
iPhone OS uses a case-sensitive file system, unlike the Simulator which uses a case-insensitive file system by default
for info:https://developer.apple.com/library/ios/qa/qa1697/_index.html
I also experienced the same problem and what I did is just deleted the UIImageview and reconfigured it and it worked. I think this is the problem with XCode new versions.
It's a problem/bug with Auto Layout constraints in iOS 7. If you remove the constraints on the UIView, it works no problem. You can set frames programmatically if you need to.
try this,
[youImageView setOpacity:1];
Actually "opacity" means "value of alpha-channel" of your UIView. When a view is fully opaque this means its alpha = 1, when a view is fully transparent (non-opaque) its alpha = 0.
As about properties of CALayer and UIView in Cocoa, they provide the same functionality.

In xcode 6.1, interface builder deleting ui elements

I have a view with some tableviews and some collection views and also some buttons and labels.
I'm not sure if this is new with Xcode 6.1 because I have not worked on the ui aspect of this project for some time. However, when I try to resize just about anything in the view, my tableviews and collection views, and possibly some other elements I am not noticing, get deleted. Specifically, it seems their frame or rect propertied get deleted.
To be clear, this only occurs when I attempt to resize the element by dragging the sides in interface builder. If I resize them by changing the numbers directly either in the IB sidebar or in the xml, this does not happen.
I'm wondering if this is a bug in Xcode or if I have done something to cause this behavior which I can change.
Thanks!
I acheived a fix, at least for this project by turning off auto layout in "show the file inspector" -> "interface builder document"
I have never used this feature in the past so I do not know if it was on in the past but I am wondering if the new Xcode version turns it on by default where the others left it off.
It may also be possible that it has always been on but there is a bug in the feature in the new version.
This fixed the issue for me, at least in this particular project and at least for now. I hope others find this useful.
From here it looks like a bug in Xcode 6.1.
I created a clean project and the behaviour is the same on my machine:
https://github.com/nasht/Xcode6ConstraintTest.git
Resizing one view makes others disappear. Changing a layout constraint from a = to <= or >= also seems to do it.
I've raised a bug with Apple. Suggest you do the same.
workaround: You can install xcode 6.01 and use interface builder from there. You can still compile and run your code using xcode 6.1 if you're relying on xcode 6.1 specific features. (you'll need to rename your xcode.app so you can run both instances. ) It's ugly, but it works.
I found that it's fixed on the next version of xcode (6.1.1)
same problem, yosemit and xocde 6.1. I can resize some view only if i disable autolayout.
I think I ran into this 'problem'. I believe this was because one of the constraints I had was not setup correctly.
What OS X Version are you on? I updated to Yosemite today and 6.1 along with it. When I would resize a label my other elements were not getting deleted but instead getting resized and repositioned. The width / height would change to 0,0 and the x / y would change to 0,0 as well.
I was noticing other issues with Yosemite so went ahead and did a time capsule restore back to Mavericks and Xcode 6.0
I had the same problem in universal app; iphone works fine and the ipad doesnt work.
I'm using xCode 6.1 and OSX Yosemite
My app supports iOS7 and iOS8 and i had the same problem on iOS7 on iPad version only
Fix:
So i fixed it by setting Simulated Metrics in interface builder by
Size = iPad Full Screen and Orientation by Landscape or Portrait
I have got the same kind of problem with Xcode 6.1 and Yosemite :
I have created a view that I have added to the main view, so it appears like a sub view in the View Controller Scene.
Then I resize this subview to 320 x 568. My program works. It corresponds to the program dropit of Stanford CS193P Lecture 9.
I save the project, close it and reopen it : the subview has its width and height set to 0 !
I tried to open the project dropit of Lecture 8 that is quite the same, which was working before (I think in Xcode 6) and same problem ! First I thought that tapping (related to the subview) was not working but found out that tapping was not working because I was tapping on a subview which has its width and height set to 0 !
I have reset the size class wCompact hAny to which all the UIElements are added. and got corrected.

Resources