How to remove scrollview sidebar swift [duplicate] - swift

This question already has answers here:
How to hide scroll bar of UICollectionView
(3 answers)
Closed 2 years ago.
I am creating a swiping controller from collection views in my app, but one problem I am having is I am not able to get rid of the thin rectangle that appears whenever I swipe from one collection view cell to the next. The rectangle I am talking about also appears whenever you are scrolling in a scrollview. I am not sure what the proper terminology for this is however I would really appreciate it if someone could help me understand how to get rid of this.

if you are using StoryBoard uncheck Show Horizantal Indicator and Show Vertical Indicator
And in code you can do
scrollView.showsHorizontalScrollIndicator = false
scrollView.showsVerticalScrollIndicator = false

Have you tried:
myCollectionView.showsHorizontalScrollIndicator = false
myCollectionView.showsVerticalScrollIndicator = false
Those properties are inherited of UIScrollView

Related

Can't click the buttons inside a TableViewCell in iOS 14 [duplicate]

This question already has an answer here:
Selectable objects on UITableViewCell not responding to user input on iOS14
(1 answer)
Closed 2 years ago.
In iOS 13 it works perfectly, but I am not able to make a simple tap on a button work within a TableViewCell. Is it happening to someone else? Has the way of doing this changed?
Solved!
You have to add your views to cell contentView like this:
contentView.addSubview(button)
and anchor your button to contentView:
button.topAnchor.constraint(equalTo: contentView.topAnchor).isActive = true

How to create an immovable TableView? [duplicate]

This question already has answers here:
Preventing UITableView from scrolling?
(2 answers)
Closed 6 years ago.
I would like to create a Sign Up page in my application and I want to create an immovable table(witch you can not scroll). I'm doing this in Swift language, if somebody knows will be very helpful. Sign Up Page
In the inspector window of the tableview storyboard turn off anything related to scrolling. And then just make sure your table view height does not exceed the view height
Have you tried setting the bounces property to NO?
You can use the following code:
tableView.bounces = false
tableView.scrollEnabeld = false
From https://stackoverflow.com/a/5344072/4882590
You can do that from your XIB as well as programmatically.
From XIB:
Just select the tableView and in Inspector uncheck bounce horizontally & bounce vertically and scroll horizontally and scroll vertically
Programmatically:
If you want to do that programmatically then you can try
self.tableView.scrollEnabled = false
OR
[self.tableView setScrollEnabled:NO];

Status bar tap should scroll table view to the top [duplicate]

This question already has answers here:
How to detect touches in status bar
(11 answers)
Closed 9 years ago.
Can anybody please tell me how to implement tap on status bar and table view should scroll to top. I also have another scroll view in that view controller for some different purpose.
Thanks in advance
If you are having more than one scrollview inside the viewcontroller, you set setScrollsToTop property to YES for the scrollview you want to scroll when user taps status bar. And also set that property to NO for all other scrollviews.
If there is only one scrollview/tableview, You don't even need to do this. It will be set automatically.
[myScrollView setScrollsToTop:YES];
[otherScrollview setScrollsToTop:NO];

What is right way to handle UITextField on a static (non scroll) page? [duplicate]

This question already has answers here:
Logic For Moving Text Field Above Keyboard On Tap
(3 answers)
Closed 9 years ago.
I have a drill-down page that fits the screen exactly, so I did not used a Scroll View. But I have an UITextField down near the bottom and when the keyboard shows up, you can't see what you are typing.
So was wondering what is standard...Should I use a Scroll View and then will iOS scroll up?
I tried to do this as a test but I am not (yet) able to add a "Scroll View" in the right way to get it to work. I kinda think if I started over and added all the controls over from scratch, I would work...but there has to be a way to convert...
First I tried to edit "View" "custom class" class property and type "Scroll View" Would have been great if it was that easy...but xcode thought it was still a view.
Then I tried to select all of my controls in the "View" and from Editor->Embed In->Scroll View menu. This seemed to work as it recognized that it is a real "Scroll View", but I get this error: "this class is not key value coding-compliant for the key delegate."
Then I created a property of "IBOutlet UIScrollView *scrollView" and tried to hook it up, but at this point, I am just guessing...I did add the "UIScrollViewDelegate" to the UIViewController of my class...
There are lots of posts about this error string, but I can't find a solution that works for storyboards and adding a scroll view to an existing (working) view.
I realize it is hard to help w/o me providing any code...but much of it seems to be how I setup the UI...
If you got any thoughts, send 'em my way!
thx!
If your view doesn't need to scroll normally, then don't make it a scroll view. Simply animate the frame of the views you need to get out of the way.
I have an answer for a similar question that you should check out, it has a lot of sample code in it that will hopefully get you on your way.
Let me know if you have any questions.

how to change colour of arrow in uitableview [duplicate]

This question already has answers here:
Which is the best way to change the color/view of disclosure indicator accessory view in a table view cell in iOS?
(12 answers)
Closed 8 years ago.
I want that the arrow of Tablecell is visible permanently. currently it is visible only on selection.
secondly i want to change its colour from white to orrange.
How i will do this.
Regards
Nauman k
You can find your answer here:
Which is the best way to change the color/view of disclosure indicator accessory view in a table view cell in iOS?