这是一个点击按钮出现下拉列表的例子。
下载地址:http://pan.baidu.com/s/1o62mYJg http://download.csdn.net/detail/qqmcy/7100541
效果图
下面是使用的代码:
需要将例子工程中的ExpandBtn文件夹考入你的工程中,例子稍后就会上传啊。
ViewController.m
//
// ViewController.m
// 点击按钮出现下拉列表
//
// Created by 杜甲 on 14-3-26.
// Copyright (c) 2014年 杜甲. All rights reserved.
//
// 角度转弧度
#define CC_DEGREES_TO_RADIANS(__ANGLE__) ((__ANGLE__) * 0.01745329252f) // PI / 180
// 弧度转角度
#define CC_RADIANS_TO_DEGREES(__ANGLE__) ((__ANGLE__) * 57.29577951f)
#import "ViewController.h"
#import "Btn_TableView.h"
@interface ViewController ()<Btn_TableViewDelegate>
@property (strong , nonatomic) Btn_TableView* m_btn_tableView;
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.m_btn_tableView = [[Btn_TableView alloc] initWithFrame:CGRectMake(100, 100, 100, 50)];
self.m_btn_tableView.delegate_Btn_TableView = self;
//按钮名字
self.m_btn_tableView.m_Btn_Name = @"神奇";
//数据内容
self.m_btn_tableView.m_TableViewData = @[@"1",@"ff",@"bb",@"007",@"oiytr"];
[self.m_btn_tableView addViewData];
[self.view addSubview:self.m_btn_tableView];
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
}
-(void)changeOrientationNinty:(UIView *)view
{
view.transform = CGAffineTransformMakeRotation(CC_DEGREES_TO_RADIANS(90));
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
iOS 点击按钮出现一个下拉列表,布布扣,bubuko.com
原文:http://blog.csdn.net/qqmcy/article/details/22160153