Skip to content
プロジェクト

MitchellMalleo/MMParallaxPresenter

GitHubで見る

概要

iOS Custom UIScrollView Class to display static text / views with a vertical parallax effect

Web・アプリ開発

この数値の測り方

計測したスター増加

24時間
0
7日間
-1
15日間
-1
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

MMParallaxPresenter

Description

MMParallaxPresenter is a UIScrollView that displays text / views with a vertical parallex effect.

Requirements

  • ARC
  • iOS 5.0+

Installation

  1. MMParallaxPresenter can be installed via CocoaPods by adding pod 'MMParallaxPresenter' to your podfile, or you can manually add MMParallaxPage.h/.m and MMParallaxPresenter.h/.m into your project.
  2. Drag and drop a UIScrollView into your Interface Builder and under the custom class section, subclass your UIScrollView to MMParallaxPresenter
  3. Now add: @property (weak, nonatomic) IBOutlet MMParallaxPresenter *mmParallaxPresenter; to your list of properties and dont forget to link it up in your Interface Builder

Usage

Add a MMParallaxPage to the MMScrollPresenter. To do this, you have three init methods at your disposal. All the default views are shown in the above gif in this order:

	- (id)initWithScrollFrame:(CGRect)scrollFrame withHeaderHeight:(int)height 
		andContentText:(NSString *)contentText;
	
	- (id)initWithScrollFrame:(CGRect)scrollFrame withHeaderHeight:(int)height 
		withContentText:(NSString *)contentText andContextImage:(UIImage *)image;
	
	- (id)initWithScrollFrame:(CGRect)scrollFrame withHeaderHeight:(int)height 
		andContentView:(UIView *)contentView;

This shows how to initalize and setup a page and add it to your presenter:

	MMParallaxPage *page1 = [[MMParallaxPage alloc] 
		initWithScrollFrame:self.mmParallaxPresenter.frame 
		withHeaderHeight:150 andContentText:[self sampleText]];
		
	page1.headerLabel.text = @"Section 1";
	
	[page1.headerView addSubview:[[UIImageView alloc] 
		initWithImage:[UIImage imageNamed:@"stars.jpeg"]]];
	
	[self.scrollView addParallaxPageArray:@[page1]];

License

MMParallaxPresenter is available under the MIT license. See the LICENSE file for more info.

関連プロジェクトを探す

読み込み中…