国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > iOS > 正文

iOS DropDown下拉按鈕效果代碼分享

2020-07-26 02:51:40
字體:
來源:轉載
供稿:網友

本文實例為大家分享了iOS下拉按鈕效果展示的具體代碼,供大家參考,具體內容如下

一、效果圖。

二、工程圖。

三、代碼。

RootViewController.h

#import <UIKit/UIKit.h>@interface RootViewController : UIViewController@end

RootViewController.m

#import "RootViewController.h"#import "NIDropDown.h"@interface RootViewController ()@end@implementation RootViewController- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{  self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];  if (self) {    // Custom initialization  }  return self;}- (void)viewDidLoad{  [super viewDidLoad];  // Do any additional setup after loading the view.    self.title=@"DropDown";    UIButton *button=[UIButton buttonWithType:UIButtonTypeRoundedRect];  button.frame=CGRectMake(10, 100, 150,30);  button.backgroundColor=[UIColor redColor];  [button addTarget:self action:@selector(doClickAction:) forControlEvents:UIControlEventTouchUpInside];  [self.view addSubview:button];       }-(void)doClickAction:(UIButton *)btn{   NSArray *dataArray=[NSArray arrayWithObjects:@"1",@"2",@"3",@"4",@"5", nil];    NIDropDown *dropDown=[[NIDropDown alloc]init];  [dropDown showDropDown:btn andHeight:[dataArray count]*36 andData:dataArray];  [self.view addSubview:dropDown];}- (void)didReceiveMemoryWarning{  [super didReceiveMemoryWarning];  // Dispose of any resources that can be recreated.}

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持武林網。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 滕州市| 靖西县| 宣化县| 洪江市| 饶平县| 井陉县| 扶绥县| 金堂县| 环江| 呼伦贝尔市| 科技| 左贡县| 剑川县| 安化县| 张家港市| 宝丰县| 桦川县| 巩留县| 鹤峰县| 岳阳县| 邮箱| 玛纳斯县| 班戈县| 桐城市| 廉江市| 昔阳县| 全州县| 湄潭县| 越西县| 合川市| 武隆县| 舒城县| 那坡县| 临桂县| 五常市| 连山| 克山县| 襄城县| 原阳县| 庆云县| 郎溪县|