开源软件名称(OpenSource Name):100grams/HGPageScrollView开源软件地址(OpenSource Url):https://github.com/100grams/HGPageScrollView开源编程语言(OpenSource Language):Objective-C 100.0%开源软件介绍(OpenSource Introduction):Page Scroll View.#An extension of iOS UIScrollView that allows scrolling of multiple pages, like mobile Safari tab viewer. HGPageScrollView uses a similar methodology to UITableView. It defines both a dataSource and a delegate, which its client can implement. At the very least HGPageScrollView expects its dataSource to provide HGPageViews to display. Like UITableView, HGPageScrollView provides a way to improve performance by reusing pages. It maintains a queue of pages that the data source has marked for reuse. A page is marked for reuse by assigning a value to its reuseIdentifier. FeaturesScrolling horizontally through multiple viewsIn its basic form, HGPageScrollView shows a stack of pages, horizontally scrollable when in DECK mode (see Selection / Deselection below), where each page is a single view derived from HGPageView. The view itself is created by the data source and must be provided to HGPageScrollView in pageScrollView:viewForPageAtIndex:. Selection / Deselection of views (aka View Modes)HGPageScrollView has two distinct view modes:
Moving between the two view modes is implicit and occurs after calling selectPageAtIndex:animated: and deselectPageAnimated:. Custom Page HeadersHGPageScrollView data source can provide custom header views to replace the default ones (seen in the exaple). A Header view is expected to have a title and a subtitle labels. The customization refers to the look and feel (size, colors etc.) of the header view. EventsHGPageScrollView provides events to its delegate on scrolling, dragging selection and deselection of pages. Advanced View Hierarchy (in combination with UINavigationController)A more advanced use case, also demonstrated in this sample project, is when the page added to the page scroller actually belongs to a viewController which is part of a UINavigationController navigation stack. Doing so allows to create a rich and powerful view-hierarchy. Inserting / Deleting / Reloading pagesHGPageScrollView supports insertion, deletion and reloading of one or more pages:
Animating page insertion/deletion will only take effect if it is done within the visible page range. Requirements
UsageImport HGPageScrollView folder into your project. In your ViewController's initialization code, e.g. in
Declare your view controller as You can extend HGPageView by deriving from it, or as shown in the sample project, define your custom view.xib and set it's top level item to be HGPageView class. Then simply load your view using NSBundle's Known limitations
LicenseHGPageScrollView is released under MIT License. Please report bugs/issues to help improve this code. Any suggestions and/or code to help improve this source will be much appreciated. Thanks! Did you find this project helpful? Please endorse me... (It's free) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论