Re: [問題] 有關navigation 返回按鈕 圖形
※ 引述《j5307 (JJ)》之銘言:
: 在做返回按鈕時
: self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]
: initWithTitle:@"影片清單"
: style:UIBarButtonItemStylePlain
: target:self
: action:@selector(backToHome:)];
: 會執行backToHom方法
: 而此時 返回按鈕的 圖形是 矩形
: 而欲想改成 rectangle shape 左邊有箭頭的矩形
: UIBarButtonItem *backButton = [[UIBarButtonItem alloc]
: initWithTitle:@"影片清單"
: style:UIBarButtonItemStylePlain
: target:self
: action:@selector(backToHome:)];
: self.navigationItem.backBarButtonItem = backButton;
: 可以產生有箭頭的矩形 但是卻無法呼叫backToHome
: 所以似乎是無法實現這部分的動作
UIButton *customButton = [UIButton buttonWithType:xxxxx];
[customButton addTarget:self action@selector(backToHome:) forControlEvent:xxx];
反正就這個button要什麼樣子你就自己做一個出來,然後:
self.navigationItem.leftButtonItem = [[UIBarButtonItem alloc] initWithcustomView:customButton];
這樣就可以了
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.243.139.152
推
11/16 11:22, , 1F
11/16 11:22, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章