In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you the example analysis of the novice guide page in iOS APP. I hope you will get something after reading this article. Let's discuss it together.
1. Find it in Main.storyboard, ScrollView and PageControl. two。 Add ImageView to ScrollView, add a few pictures to the novice guide page, and then set the image of ImageView, which is the prepared image. 3. To set the Left in ScrollViewscroll View and the Width in View so that they are equal to the size of the picture, there is the starting position of the size of the picture, the first one is (0), the starting position of the second should be (width of the screen, 0), and so on. 4. To add PageControl, the starting position of this should be set manually. 5. Set synchronization / / set UIPageControl to change with the change of UIScrollView-(void) scrollViewDidEndDecelerating: (UIScrollView *) scrollView {_ pc1.currentPage = scrollView.contentOffset.x / 424;} / / if you want UIScrollView to change with UIPageControl, you must listen and write a method-(void) changeScrollView: (UIPageControl *) uip1 {[_ sv1 setContentOffset:CGPointMake (424 * uip1.currentPage, 0) animated:YES] } source code: # import "ViewController.h" @ interface ViewController () @ property (weak, nonatomic) IBOutlet UIScrollView * sv1;@property (weak, nonatomic) IBOutlet UIPageControl * pc1;@end@implementation ViewController- (void) viewDidLoad {[super viewDidLoad]; / / must manually set the size of the content view _ sv1.contentSize = CGSizeMake (42403736); / / whether to page _ sv1.pagingEnabled = YES; / / whether the horizontal scroll bar is displayed when scrolling _ sv1.showsHorizontalScrollIndicator = NO / / whether to display the vertical scroll bar when scrolling _ sv1.showsVerticalScrollIndicator=NO; / / in order to set UIPageControl, the proxy method is used to determine whether to move _ sv1.delegate = self; / / if you want the UIScrollView to change with UIPageControl, you must listen and write a method [_ pc1 addTarget:self action:@selector (changeScrollView:) forControlEvents: UIControlEventTouchUpInside] } / / set UIPageControl to change with the change of UIScrollView-(void) scrollViewDidEndDecelerating: (UIScrollView *) scrollView {_ pc1.currentPage = scrollView.contentOffset.x / 424;} / / if you want UIScrollView to change with UIPageControl, you must add listening. To write a method-(void) changeScrollView: (UIPageControl *) uip1 {[_ sv1 setContentOffset:CGPointMake (424 * uip1.currentPage, 0) animated:YES];}-(void) didReceiveMemoryWarning {[super didReceiveMemoryWarning] / / Dispose of any resources that can be recreated.} @ end has finished reading this article. I believe you have some understanding of "sample Analysis of novice Guide pages in iOS APP". If you want to know more about it, please follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.