2016-01-20 75 views
0

Ios drop down need little arrow如何帶來下拉的IOS

我想下創造出一個下降爲我的項目頂部的小箭頭,但由於圖像中提到的,我不能把箭頭符號

請有人幫我創建這個下拉.......

我想下創造出一個下降爲我的項目,但我不能把箭頭符號作爲圖像

中提到的請有人幫我創建這個下拉菜單.. .....

@implementation DropdownViewController 
@synthesize tabview; 

- (void)viewDidLoad { 
    [super viewDidLoad]; 
    // Do any additional setup after loading the view. 

    // Initialize table data 
    menu = [NSArray arrayWithObjects:@"My Account", @"Terms of Use", @"Privacy Policy", @"Version",@"Logout", nil]; 
} 


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{ 
    return [menu count]; 
} 


-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *simpleTableIdentifier = @"SimpleTableCell"; 

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; 

    if (cell == nil) 
    { 
     cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier]; 
    } 

    cell.textLabel.text = [menu objectAtIndex:indexPath.row]; 
    return cell; 
} 

- (IBAction)btn1action:(id)sender 
{ 
    if (self.tabview.hidden==YES) 
    { 
     self.tabview.hidden=NO; 
    } 
    else 
    { 
     self.tabview.hidden=YES; 
    } 
} 
+0

我有想法triying在tableview中顯示和隱藏點擊輪圖像時,但不知道帶來的圖像,但沒試過。 – VyTcdc

回答

1

你可以試試這個代碼

UIImageView *arrowImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow"]]; 
arrowImageView.frame = CGRectMake(0, 0, 44, 44); // Or whatever you like 
arrowImageView.center = //circle button.center. The button where you want it to be displayed. 
[self.view addSubview:arrowImageView]; 

// Set the table below the image and add it to subview 
tableView.frame = // Your frame