I have a very strange problem since I updated iPad on iOS 8.1.3.
Anywhere in the app where some label needs to go with multiline (numberOfLines set on 0) it crashes on when drawing rect or on sizeToFit.
This was working just fine on iOS7.
Here is call stack when crash happens: http://s16.postimg.org/txnmngglh/Screen_Shot_2015_02_09_at_11_01_41_AM.png
Just Uncheck Autolayout & try again.
If you don't want to Uncheck Autolayout than simply add this line:
Your_TextView.numberOfLines = 0;
Hope it will work for you.
Related
I have older code, written for iOS 6. I need to implement it for iOS 10 with some new SDK. I have some XIB's. Everything was working perfectly when I was changing them. But in one XIB, when I try to change Image in my Interface Builder of UIImageView, whole layout just collapses. I have 2 views, called TopBar and Content. When I try to change just background image of TobBar View, Content view just collapses, actually, TableView in Content View just goes off the screen on the right and you can scroll to right to see content of a cell. Everything is shifting in my Content View to the right. In my XIB, image view is shifted, TableView is so big to the right. When I place everything as it was, sam thing is happening after build. I have been reading for some time now, and changing from XCode 8 to XCode 7.x in my IB does not work, layoutIfNeeded does not work. Does anyone knows what's the problem? Code still uses Autoresizing masks.
Anyone in same situation as me: in XCode 7 it is working. So, I draw in XCode 7, and build in XCode 8, but I need to build for like 8 times, when it fixes itself. I have reported a bug to Apple.
I've a problem with the scrollview in IOS 7.
at first, it didn't work at all not even on IOS 7 or IOS 8
but after I added this code:
it starts working on IOS 8 but still not working on IOS 7.
[scroll addSubView:contentViewScroll];
scroll.contentSize = contentViewScroll.frame.size;
can any one suggest a solution??
Your contentSize needs to be bigger than your frame size in order for your scroll view to be scrollable.
I've fixed the problem...
as everybody says, my content size was bigger than the scrollview frame size, but the scroll was not working. after spending hours in this issue, I've managed to fix it by fix all the warning on the controllerview. after all the warnings are fixed the scroll starts to work.
maybe this sounds stupid, but fixing the warnings got the scroll working at last
I have been using UISearchbar in my project with no problem at all in iOS7 now when i build my project using Xcode 6.0.1 and run on iOS8 the width of UISearchBar automatically changes for example
If my app is in landscape mode (iPad) and the search bar was in center and had 200 points then this width changes to full 1024 automatically.
I am not using auto layout, when i enable auto layout the issue is solved but whatever i do to change the frame in code nothing happens.
I don't want to enable autoLayout, how can i solve this problem?
I solved this problem by using following code
-(void)viewWillLayoutSubviews
{
searchbar.frame = CGRectMake(365, 0, 274, 44);
}
Hope this help someone
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.
I encountered a strange behaviour of a view in an iOS 6.1 app which I tried ran with the iOS 7 beta 2 and on my iPhone.
This app has a UINaviagationController which works fine if I run it in the iOS 6.1 simulator. However, with the Xcode DP the bottom part of the view is cut off. See picture.
Does anyone know how to fix this? I am drawing the box that you see as cut off on the bottom (self.frame.size.height) of the UIView which is managed by the navigation controller.
Thanks.
try subtracting the size of the box by the amount of the toolbar at the top. When using the self.frame.size.height, it will use the entire height as the location on the view, so when subtracting by the toolbar/navigation bar, it will raise that up just enough to fit the entire box onto the view
//clearly not objc but its just to show you how to implement it
boxLocation at (self.frame.size.height - (amount of toolbar/nav bar))
Hope this helps!