fdzsergio/SFFocusViewLayout

Using last visible cell as Focused View?

gauravlnx opened this issue · 7 comments

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

@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

@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.

@gauravlnx Okay Let me try. Thanks.

Please let me know if solved. :)

@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.

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

@gauravlnx I solved by my self.

  1. Rotate tableview
  2. Rotate tableview cell again.