Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using last visible cell as Focused View? #9

Open
gauravlnx opened this issue Aug 8, 2016 · 7 comments
Open

Using last visible cell as Focused View? #9

gauravlnx opened this issue Aug 8, 2016 · 7 comments

Comments

@gauravlnx
Copy link

Hi,

What do I need to do if I want to make the last visible cell as the focused view instead of the first visible cell?

Thanks

@ektapadaliya
Copy link

ektapadaliya commented Sep 14, 2016

@fdzsergio
@gauravlnx

Hi Gaurav,

Did you find anything ? Because I want exactly same that you want.

Please help me if you found or just suggest me how can we achieve the same.

Thanks

@gauravlnx
Copy link
Author

@EMakadiya Sorry. I haven't found anything about it yet. I tried to create it manually but unable to figure out the location of the cells in relation to the content offset.

@ektapadaliya
Copy link

@gauravlnx Okay Let me try. Thanks.

@gauravlnx
Copy link
Author

Please let me know if solved. :)

@ektapadaliya
Copy link

@gauravlnx Sure will let you know. Can you please tell me that what you tried?

Till Now I understand that they are changing the frame of all items according to offset.

@gauravlnx
Copy link
Author

I can't remember exactly what I did but mainly I tried to calculate the size and prosition and cells in prepareLayout() method. I tried to calculate in reverse also i.e. last cell at the bottom( of contentSize) and previous cell just above it.

I far I am able to understand, main changes have to be made in the following methods:

  1. prepareLayout(): to calculate layout attributes for each cell.
  2. currentFocusedItemIndex: This variable should return the focused index which is currently at the bottom of the screen.
  3. nextItemPercentageOffset: a value between 0 and 1 that represents how close the previous cell is to becoming the featured cell
  4. targetContentOffsetForProposedContentOffset() : This methods tell where the content offset should be when released

@ektapadaliya
Copy link

@gauravlnx I solved by my self.

  1. Rotate tableview
  2. Rotate tableview cell again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants