Can't change UITableView section index list position from center to top - ios

I want to change the position of section index list of UITable view which is always in the center of the table view. I want to change the position to top. For example, I want the section index to start from top and then make its way to the bottom but can't find any resource to actually do that.
In the red box is the default position but I want the position to be in the green box. I would really appreciate if anyone can help. Any third part source would work as well. I tried finding things here and there but to no avail.

Related

How to center content inside collection view in exact center of shown ring view while scrolling horizontally (iOS)?

I want to set center the content inside a UICollectionView according to ring image in the center of the whole screen. Please check the image below. Any Suggestions?
The function you need is this one... https://developer.apple.com/documentation/uikit/uicollectionviewdelegate/1618007-collectionview
This function is called by the collection view when the user finishes scrolling. It provides the content offset of where the collection view will stop scrolling. (The proposed content offset).
You then need to take that offset and work out the nearest offset to place your cell in the middle of the screen.
Something like, find the item that will be closest to the middle. Work out how far away from the middle it is so you know how much to shift it by. Then apply that shift to the proposed content offset.
This will allow your collection view to decelerate naturally but always stop at the point that you want it to stop.

Tablix inside Rectangle inside Textbox not visible when report renders

I have built a report with a list of caveats at the end within a text box. Inside this list I need to display a table of static text. The only way I have found to show the table is to put a rectangle inside the text box and place the table inside the rectangle. However when I preview the report the table does not show. Also when in design mode if I click outside of the rectangle into the text box both the rectangle and table disappear and only reappear when I use the scroll bar. I have checked that both the rectangle and table are visible and have tried moving to front and moving back but it does not change. Can anyone point me in the right direction please.
To help with explanation I have added screenshots:
Image 1 - showing table in rectangle in text box in design view
Table 2 - showing result of preview where table should show
If I had been thinking straight and built this from scratch I would never have tried to do it the way I did. I suddenly realised that the answer was simple. Put a rectangle first then populate it with 2 textboxes and put the static text table between the 2 textboxes. The rectangle holds it all together and can have a border if required.

UITextView scrollRangeToVisible make range visible appear at the top

I am currently using UITextView. When I use scrollRangeToVisible it works but it brings the range to the bottom of the screen. How can I bring this range to the top of the screen. TLDR: UITextview method scrollRangeToVisible brings the characters of interest to bottom of view. I want it to come to top of view. How can I do this? Thank you
One approach is to:
find the bounding box of the range you want at the top
if it's below the current top line, add the height of the text view
then call .scrollRectToVisible()
You also need some error and bounds checking. I put together an extension you can try out if you wish: https://gist.github.com/DonMag/19daac863553c51725a56f0bc3296076

How to implement scroll view moved by tableview?

When I move collectionView(foods with picture and price) up or down, the buttons (or tableviews, categories of food)in the red rect will scroll to the corresponding position. Anybody could kindly give some keywords or link that have sample example?

UIViewController with UITableView and TextField storyboard placement

This might be a simple question but using storyboard I can't seem to position my table, a message field and a button correctly. In the picture below, if it's positioned that way, only then do I get to see the text field and button at the bottom of the screen and the table view takes up the rest of the screen. If I drag the text field and button to the bottom and resize the table, the text field and button disappear and the table is cut off. Why is that? Is there a solution to this without doing it programmatically?
Easy solution is to remove all constraints then position them where you want them.
You'll find you get different effect when try to reposition items depending where you drag from for example double tap an item and nudge it with arrow keys or grab the middle to move it resizing via the corners.
But in my opinion it's easier remove all constraints from the view and then set them as you go.
Also you might want to consider using a container view for the table view and have a separate UItableViewController that way you can easily separate out that the tableview logic from the other ViewController. It will help stop things getting a little messy later on as project grows.

Resources