Tutorial details

Image Alpha Slider | App Code for Sale | Preview

Image Alpha Slider | iOS Tutorial

How to change the alpha of an image using a uislider

Overview PAGE TOP

Reference: http://www.geekylemon.com/WEBPROTECT-xcodealphaslider.htm

In this tutorial i will be showing you how to change the alpha of an image using a uislider


  • 1 UISlider
  • 1 UIImageview
  • 1 UILabel

This is a great feature to any app allowing the user to have control over imges and able to display the state in a label

ViewController.h PAGE TOP

@interface ViewController :UIViewController {
IBOutlet UISlider *slider;
IBOutlet UIImageView *imageview;
IBOutlet UILabel *label;

ViewController.m PAGE TOP

@implementation ViewController
-(IBAction)imageslider {
imageview.alpha = slider.value;
label.text = [NSString stringWithFormat:@"The Alpha Is Set To %1.2f", slider.value];

When linking the action to the slider make sure you select value changed

Reference PAGE TOP


0 Comments Leave a comment

Please login in order to leave a comment.

Newest first

to your Chupamobile Account.

The Easiest way to Launch your next App or Game.

Join Chupamobile and get instant access to thousands of ready made App and Game Templates.

Creating an account means you’re okay with Chupamobile’s Terms of Service and Privacy Policy.