Text starting at wrong position in textview in Xcode 6 - ios8

There's no code involved at the moment, only storyboard or xib files as far as the textview is concerned. This is what I get when running the app on my iPhone 5s or via the simulator.
I'm using auto layout and size classes with the option any width-any height. An imageview at the top, then a label, then the textview.
Here's a picture of the screen. As you can see, it looks as if the text is starting behind the label, but the textview's y is after the label and the constraints seem all correct according to Xcode 6. It works fine on iPad.
Any idea of what I'm doing wrong?

I've found a way round it: textview should have no scrolling enabled and should be put in a scrollview instead, which will do the actual scrolling. Need to add constraints to both.

Related

Unwanted grey area when simulating iPad Xcode 11/SwiftUI

Question: Can someone identify why I am getting the extra grey area shown in my add item (top screen in screenshot) and how to eliminate it?
I have tried manually setting the size of the background object, removing and re adding constraints, clicking all the Xcode generated solutions for handling the autolayout errors shown below, setting the presentation setting to full size ala this answer all to no avail; it refuses to be consistent with the main menu screen (bottom)
Context:
Running Xcode 11...I have two scenes in a generic barcoding app, the main menu and the add item scene, and I am designing with iPad's in mind. With the size class for ipad pro 9 (wR hR) and set to landscape orientation, my add item scene has a huge amount of gray area bordering the visible content, unlike the main scene (though there is also a little grey area in portrait)
Figured out what was causing my problem; was using the wrong form of segue between screens, per this answer, in my case, a modal segue when I should have just been doing a show segue. Deleting and adding show segues with the presentation set to Full Screen in the destination views Attributes inspector did the trick.

iOS Black bar issue when using auto layout

I am using Auto layout in my app. I have added constraints on my view. It is working fine in all iPad simulator and iPhone 4s. But when I run this app on iPhone 5s or greater it is showing black bar on left and right side of the screen.
I have also faced this same issue, when I am converting my iPad app to Universal app.
Ref below Image: You can see Main Interface is not set
After that add LaunchScreen.storyboard to your project if not exists.
Ref this Image: Goto your ProjectName-Info.plist add following key
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
Now run the project
Go to your Storyboard. Click on the UIView. Click on the third icon in the auto-layout stuff on the bottom. Now click all of the red line things in the top (stuff circled in pink in below picture) to be set at zero.
EDIT: another possibility is that you have constrained the size of the view in some way. I would try doing reset to suggested constraints, and then set the constraints illustrated above for the background (grey) view so it fills everything up, but do not set it to have an explicit size.
EDIT 2: If that grey thing in the background is a UIImage, I bet the issue is that it is in Aspect Fit. Change the content mode to Aspect Fill and I think it should work.

App display does not fill iPad screen

I'm converting an app that I made for iPhone to be used on iPad. Using constraints on the Xcode 6 storyboard is killing me right now.
With my rep score I can't post an image of what I'm getting, but basically even when I set the constraints and the placement of the object (a UIView) on a storyboard sized for iPad, all the objects on the viewController fill only the top/left area of the screen.
What's the best way to handle this?
-- when you change size of view, other view will be auto change to {0,0,0,0}, isn't ?
but it doesn't change in the right panel.
it is your storeboard files some settings have some wrong.
Demo test link http://www.cocoachina.com/bbs/job.php?action=download&aid=80409
Check for those points:
hope this can help you.

Text views and image view disappearing from view controller in Xcode 6.1 storyboard

I updated to Xcode 6.1 to fix an error I was having with the Interface Builder Cocoa Touch Tool spiking to 99% CPU usage when I used the storyboard, which would freeze Xcode. Now that that error is fixed, I have a possibly even more frustrating error.
When I use the storyboard, while I'm working on a UIViewController, my UITextView, my custom UITextViews (which are subclasses of UITextView, but for all intents and purposes in the storyboard, they're UITextViews), and my UIImageView suddenly disappear!
Here's how the default main view inside my view controller looks right now:
Main View
View
Activity indicator
Scroll view
Label
Text view (x=0, y=-65, width=0, height=0) ERROR!
Label
Custom text view (x=0, y=-65, width=0, height=0) ERROR!
Label
Custom text view (x=0, y=-65, width=0, height=0) ERROR!
Label
Custom text view (x=0, y=-65, width=0, height=0) ERROR!
Label
Label
Custom text view
View
View
Label
Button
Image view (x=0, y=0, width=0, height=0) ERROR!
ViewX
Label
Custom text view (x=0, y=-526, width=0, height=0) ERROR!
Width and height Constraints for this view.
Button
Width and height constraints for the scroll view
Center x and y constraints for ViewX within the scroll view.
Center x and y constraints for the scroll view within the main view.
It all started when I adjusted the size of the view controller using "freeform" in order to see views that were off the view controller screen. Once I used cmd-Z to change the view controller back to "fixed" (to the normal size), the missing elements appeared again and everything seemed fine. However, later on, I was editing the view controller and suddenly...bam! They're gone. And when I reset all of them to where they were supposed to be, it just happened again (resulting in the above described x, y, width, height values).
:-(
Does anyone know what could be wrong? I never had this error in Xcode 5.
EDIT:
I was able to use cmd-Z to get the view controller back to normal. Then I restarted my mac and reopened Xcode. Now, I've noticed that the error occurs whenever I resize anything in the storyboard by dragging with the cursor (it doesn't happen if I resize something using the width and height properties on the right panel in Xcode). It happens on other view controllers as well. Even in a view controller that has only a UILabel and a UIImageView in the default main view, when I click and drag the edge of the label to resize it, the image view disappears with values of x=0, y=-64, height=0, width=0.
CONCISE SUMMARY:
In the Xcode 6.1 storyboard, every time I resize any elements in a UIViewController, all UITextViews and UIImageViews collapse and get shoved -64 pixels above the upper left corner of the view controller.
UPDATE
It appears that Xcode 6.1.1 has fixed the bug.
Another workaround is to add constraints to the layout Before resizing of any views. (add missing constraints e.g.). The bug only seems to occur when there are no constraints available. I have reported the bug to Apple with Bugreporter.
Edit: So, at least it seems that Apple Bugreporter is working. The problem is fixed in XCode v 6.1.1.
Seems it's a bug in Xcode 6.1 !!
The current solution is you should resize your elements from the Size Inspector.
Never do the resizing by mouse...
If you uncheck "Use Autolayout" then it won't occur either. Though, you're back to using the old "springs and struts" method. Still, this can be set on a view controller by view controller basis so it's not too bad.
I was having the same problem. I just went to the Apple Developer website and downloaded the beta version of the new Xcode and they fixed this bug!
I just installed XCode 6.2 Beta and the issue seems to be fixed there.
There are 2 types of 1 is main storyboard and 2 is launchscreen storyboard
Your are placing all your views on launchscreen this appears when you app first time then it will not appear
Place all your views on main storyboard instead of launchscreen

Cocoa layout OSX (WebView - fill the space on the left + TextView - sidebar on the right with fixed width) how?

i have spent hours and hours googling and trying to figure out how to make the layout work as described in the question.
I have put the WebView control inside the Window so it can fill the space, that is fairly easy and everything is working like a charm. On the right side, though, I would like to have a sidebar - which is basically a TextView with fixed with (I can toogle visibility of this).
Strange thing is, that if I put those Views next to each other (WebView on the left) and I am resizing the window, the web view is just keeping the size and TextView is being resized.
When I put the TextView on the left, again the TextView is being resized and the WebView is keeping the size, but I want TextView to keep its width and the WebView to resize.
Am I missing something? Probably yes..
So, thanks to TheAmateurProgrammer, the issue was checked Auto-layout # xib file.

Resources