Code Create picture Playback
#import "ViewController.h"
#define KLENGTH the
@interface Viewcontroller ()
@property (nonatomic, weak) Uiimageview *myimage;
@property (nonatomic, weak) UILabel *mylabel;
@property (nonatomic,weak) UISlider *myslider;
@end
@implementation Viewcontroller
-(void) Viewdidload {
[Super viewdidload];
// Create Image Control
//1 Creating Controls
uiimageview *myimg= [[uiimageview alloc]init ];
Self. myimage = myimg;
//2 Adding Controls
[Self. View addsubview:self. MyImage];
//3 Set Button Position
Self. myimage. frame = cgrectmake(a) ;
//4 the default state property
Self. myimage. image = [UIImage imagenamed:@ "0"];
// Create lable Control record number of pages
//1 Creating Controls
UILabel *mylbl = [[UILabel alloc]init];
Self. MyLabel = mylbl;
//2 Adding Controls
[Self. View addsubview:self. MyLabel];
//3 Set Control position
Self. MyLabel. frame = cgrectmake(a) ;
//4 the default state property
Self. MyLabel. text = [nsstring stringwithformat:@ "0/%d",klength];
Self. MyLabel. textalignment = Nstextalignmentcenter;
// Create Progress Control
//1 Creating Controls
uislider *myslid = [[uislider alloc]init];
Self. Myslider = myslid ;
//2 Adding Controls
[Self. View addsubview:self. Myslider];
//3 Set Control position
Self. Myslider. frame = cgrectmake(+, 260, +) ;
//4 Adding listener Events
[Self. Myslider addTarget: self Action:@selector(btnslider) forcontrolevents: Uicontroleventvaluechanged];
//5 the default state property
Self. Myslider. MinimumValue = 0;
Self. Myslider. MaximumValue = klength;
}
-(void) Btnslider
{
//slider The current value takes an integer
nsstring *nowvalue = [nsstring stringwithformat:@ "%.F",self. Myslider. value];
Self. MyLabel. text = [nsstring stringwithformat:@ "%@/%d", Nowvalue, klength] ;
Self. myimage. image = [UIImage imagenamed: Nowvalue];
}
@end
Code to create a picture rotation; How to define a control as a property when creating a control