1

First sorry for the last post ,this one i' ll make it short :

I would like to control the alpha of a view or subview , using a UISlider ; i tried hard , but i fail ..

Here' s my exemple ( not working ) ;

Simple ViewController , with a view in it ( cassetteView ) and a UISlider ( alphaSlider )

@interface ViewController : UIViewController

@property (strong, nonatomic) IBOutlet UIView *cassetteview;

@property (strong, nonatomic) IBOutlet UISlider *alphaSlider;

-(void) sliderValueChanged: (id)sender;



@implementation ViewController

@synthesize cassetteview;

@synthesize alphaSlider;


- (IBAction)alphaslider:(id)sender {

  //here may be the miss of code ..?  }

- (void)sliderValueChanged:(UISlider *)sender {

    self.cassetteview.alpha = sender.value;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

}



@interface cassetteView : UIView

@property (nonatomic, assign) CGFloat alpha;





@implementation cassetteView

@synthesize alpha;

Hope this post is clear and that you guys could help me figure out how to do it ..Thanks a lot for your time.

Lucas ( Belgium )

( my goal at the end is to control the alpha of multiple UIImageViews in a ViewController , using multiple UIISliders .. do you think i m dreaming ..? )

4

1 回答 1

0

将 UISlider minimumValue 设置为 0.0,将 maximumValue 设置为 1.0。

于 2013-06-22T23:41:47.793 回答