Scroll bars not displaying for NSView placed inside a NSScrollView in MacOS application using XCode - nsview

I am running with an issue where the Label text which is placed inside NSView is getting cut off at bottom and right side of content view & even scroll bars are not getting displayed. I am using Xcode 11.3 in macOS Mojave 10.14.
I have dragged NSScrollView onto my view and set the following constraints to the NSScrollView
Now, i have dragged a Label to the content view of NSScrollView, added a huge text to the Label such that it crosses the NSScrollView horizontally as well as vertically and added the following constraints to it
The following screenshot shows the project structure that i have implemented for displaying horizontal and vertical scroll bars
After running the application i found that the scroll bars are not getting displayed and the text is getting cut off at the bottom and to the right of the content view. Please check the screenshot below regarding the output that is obtained .
Can you please suggest what needs to be done in order to display the scroll bars for viewing the text that is getting cut off?

Related

alignment issues when using stack views

I have a label in the top left corner that say "Categories", a back button in the bottom left corner.
In the center of of the view is a stack view containing four other stack views. All of them with 3 buttons.
Each time I run it in a simulator the category label in the top left disappears.
I've attached several photos to show current constraints and what my layout should look like and what shows in the simulator.
Thanks
View in interface builder
Constraints view
So it appears it was the image I was using as the "background picture" of each button that was causing my layout issue. I removed it and everything fits now. Thanks

Xcode not respecting the constraints on my iphone xib file

I am having problems figuring out why Xcode is not respecting the constraints on my iphone xib file.
This is how I set a button in the xib file:
and this is how it appears in the simulator:
and this is how it appears in the simulator:
I defined the size of the button:
Any of you know what I'm doing wrong?
I'll really appreciate your help.
If you want the button to stay at the center of the view, you just need two constraints.
vertically center in container
horizontally center in container
Add this two and get rid of the vertical space containers.
Don`t no much about constraint but u can remove it with Doing uncheck in AutoLayout in property editor.
And than palce your button and make it center horizontal and center vertical from property editor of xib.
And make all bounds pack in AutoSizing given in property editor.

iOS : How to make TableView not to fill the height?

I've created a tableview, in the xib editor of the xcode. I've positioned the table view in the middle of the screen, it starts somewhere in the middle (100 pt. form the top) and should end a little bit lower (it's total height is 200 pt.). But when I run it on the simulator it fills the height of the TableView until the bottom of the screen.
Sorry for the nooby question. I'm just starting with iOS after years of java.
Screensot
Go to the Size inspector tab. and remove the bottom resize from xib just like this screenshot
Just go to file inspector tab and disable (un-checked) the Use Autolayout

Appending a scrollview (horizontal) to a view which has a scrollview (vertical) and two labels Iphone sdk

I have developed an iphone application which has 6 cards (icons with images) in the Rootview. Clicking on a card would bring another view which the image being enlarged (fullScreen). The Card View has a Flip button which shows the back side of the Card which contains some text. Different cards hold different text on their back. Depending on the text size the view will be scrollable. I used two labels: one for title of the text and and second label having the whole paragraph. I have placed a scrollview below the two labels for vertical scrolling.
When a nth card is clicked from the Rootview the selected card should appear. It works perfectly. I used a separate view to design the front view of card and a different one for the text on the back. The issue is when a card is opened and flipped to see the text, it should be scrollable horizontally too apart from scrolling vertically. I dont want to redo anything. I have placed the vertical scrollview and the labels on the view representing back of card. I added another scrollview and enabled its paging property and wrote code in the following functions.
scrollViewDidScroll:(UIScrollView *)sender;
scrollViewDidEndScrollingAnimation:(UIScrollView *)newScrollView.
But it is not working as desired. No scrolling works (even the vertical 1 which was earlier working fine. I mean when i combing the horizontal scrolling both stop working.
How do i allow vertical and horizontal scrolling to this view which has two labels.
I would appreciate your help...
Thanks in advance
I solved it.
I used a table view to hold the card back details. So i get vertical scrolling by default.
I took a scrollview which will hold as many number of tableviews as there are cards.
And it is done

Why can't I tap input elements after I resize a scroll view?

I have a sample project that uses the metrics from notifications for resizing the keyboard when a text field is focused.
http://www.smallsharptools.com/downloads/ObjC/KeyboardSize.zip
The series of text fields are all wrapped inside of a UIScrollView and when the keyboard is shown a notification is sent with the height value. I use that to decrease the height of the UIScrollView so that all of content can scroll inside without being covered by the keyboard.
But I find that when I do this the other text fields sometimes cannot be tapped. They seem to be covered with a layer that I cannot see.
What can I do to ensure that the input elements in the UIScrollView remain accessible when the height is changed?
FYI: You can see in the sample project there is a blue marker on top and another red one at the bottom. The view controller which handles the resizing is CMScrollingViewController which is inherited into KeyboardSizeViewController so that this behavior can be used by multiple view controllers.
I am hoping that this problem can be fixed so this simple code can be reused.
I figured out my problem. I was setting the view which goes inside scroll view to flex the height and width using the autoresizing mask. Once I commented out that line of code this problem went away. It seems it was resizing the view but I could still see the contents of the view but it was outside the bounds of the view so it could not respond to taps.
//self.subView.autoresizingMask = (UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);