1
사용자가 테이블보기를 스크롤 할 때 탐색 막대의 알파 값을 변경할 수 있는지 물어보고 싶습니다.스크롤 할 때 탐색 막대의 알파 편집 tableview
나는 알고리즘을 가지고 있지만, 실시간으로 변경 사항을 얻으려면 도움이 필요합니다.
/* This is the offset at the bottom of the scroll view. */
CGFloat totalScroll = scrollView.contentSize.height - scrollView.bounds.size.height;
/* This is the current offset. */
CGFloat offset = - scrollView.contentOffset.y;
/* This is the percentage of the current offset/bottom offset. */
CGFloat percentage = offset/totalScroll;
/* When percentage = 0, the alpha should be 1 so we should flip the percentage. */
scrollView.alpha = (1.f - percentage);