The example project is at https://github.com/ivailon/test-008. The issue is that during resizing of the column width while editing cell, the field editor is not resizing correctly. In other words - once I start editing a cell, if I begin resizing the column, the field editor not only resizes incorrectly, but starts to act really strange - in most of the cases the text disappear or it's not possible to see what you are editing.
The example is simple enough .... just try it.
Is there anyone who can at least give an explanation why this is happening?
EDIT:
Problem solved. If someone is interested - the solution is in resizing the container too. I don't know why the container resizes only to smaller size ... maybe a bug in appkit ... maybe I'm missing something.
Related
I’m creating an app and need to make a signup/login page. I added a background using a picture and a zstack and on top I have the text and text fields. The text fields are showing up but not allowing me to add padding as well as there is no title text showing. Please help.my code
Did some more testing to find out that this happens whenever I use a textfield over an image. Not sure if this is a bug or not but it seems to be because as soon as the zstack is removed everything works.
At last ive discovered the issue, the text fields are extending way out of the canvas. Ive fixed the width of the textfield as a temporary solution but still looking for a way to fix this relative to the screen rather than the background as the field extends to the size of the image. Let me know if you can help as im just starting to use xcode!
I think its because the image cause canvas to be much more bigger and you use edgesIgnoringSafearea(.all)
Try to use on the image clipped() method and i think it will fix your issue with the padding.
And also try to add foregroundColor to the test fields
I want to fit the Image + Label into Scrollable View.
It looks like so My setup
So trouble here is that width of the picture and the label did not match the screen width.
I tried to change the UIImageView width from 400 to 300 or so, BUT those changes either wont take the effect(if above 300), OR those changes make label disappear (with width setted up on 300 or below). Observe.
Funny thing is - label actually appears when you see view hierarchy, even though it looks kinda distorted. But no label on the iOS screen for you, sir.
I also tried to set equal width and height from the superview, but this option just disabling scroll, making view strictly fit the screen (label appears to be cropped)
I want the label to be nice and scrollable, but I also want to see it on the screen. Too much to ask?
EDIT: I just tried removing Auto-layout and got the same as with auto-layout. (click "Observe" link to take a look again, exact same situation) Could somebody explain why?
This is quite a simple fix. For the image, you should use equal width & center horizontally; however, make sure you use a fixed width. For the image to look nice, play with the scale modes - I find Aspect Fit/Fill work best.
The label should also be equal width & centered horizontally. You may need to calculate the height of the label programmatically if the text isn't always going to be the same size.
So the answer to my particular question was - shortening the actual text that is passed to the label.
Apparently UIScrollView can't handle stuff with crazy abnormal heights (I was passing a huuuge text to it) So in my particular situation solution was - shorten the text. Now it works like a charm (even though I still need to play a little with constraints to get rid of the warnings and stuff)
I have a NSWindow with autolayout, There is one view based NSTableView with few controls like images and labels . Once in a while the window comes ugly, means all the constraints doesn't work, and the text fields, images just loose their places.
All the controls inside the tableView are seen in (0,0). But only for few rows, for other rows it work perfectly, however all rows contains same controls.
This is happening only for the first time specially in OSX 10.10 when installing from DMG, if I reopen the window again then every thing look OK, no overlapping of text and other controls.
Please help to understand the issue, or any suggestion to fix.
OK, this might seem very simple but I've been struggling for too long, so I decided to ask for some help.
Basical, I've got a container NSView.
The contents are (from left to right):
an NSSegmentedControl
an NSTextField
an NSSegmentedControl
And they are all aligned horizontally (= they're in the same "line").
What I'm trying to do is:
Fixed width for the first element, and fixed on the left
resizeable textfield
Fixed width for the last element, and fixed on the right
I guess it's pretty self-explanatory.
And here are my autoresizing settings for the 3 views:
View 1
View 2
View 3
And here's the issue: the whole resizing works fine. Until the textfield is resized at such a point where it is collapsed. When the superview/container is resized at a normal size again, the whole design is messed up (with the textfield overflowing the container and lots of such weird issue).
What's going on? Any suggestions?
Note: I got it to work with Auto Layout (merely setting "Auto Layout" and "Add(ing) missing constraints"), but I most definitely want to avoid it since the performance impact is huge -- the overall design is rather complicated, with lots of nesting, so let's stick to the old-fashioned way. :-)
The old springs-and-struts model using autoresizing masks is based on proportional distribution of the change in size based on the current sizes of the subviews being resized. Once any subview gets to zero size, it goes haywire. Either there's division by zero or multiplication by zero and you get bogus results. This is a long-standing issue with the system.
You must set minimum window size to prevent that from happening.
Auto layout is the solution to that and many other limitations of the old model, for all of its flaws.
If I turn the autocorrection ON, the words get autocompleted, as if I write "wor", I get "word" before I finish writing. I don't want this to happen because I might be writing "world" or any word different than the autocompleted one.
I set Correction off in the Interface Builder and this problem is solved.
The problem now is that I still need the suggestions that appear in a little popover below the incomplete words.
This two features might be different but I don't know how to activate the suggestions.
How can I solve this?
This can be solved with the use of tableview. Create a tableview with the width as of the width of the textfield and height as you like. Place it just below the textfield. Make it hidden initially. When the user starts typing, fetch the array of data that resembles to the typed text and if any exists then, unhide the table view. On the subsequent typing keep on reloading the tableview sections with animations. You should be accurate on hiding, unhiding and then reloading the data on the tableview. I have implemented such thing before. It is really easy and once you get started with it you find it easy.
In the UITextView TextViewDidChange I created a thread that changed the cursor position. This, off course happens after the text view changes. The change of the cursor position triggers the autocomplete without letting me even see that there had been a suggestion.