![](/img/trans.png)
[英]iPhone, is it possible to remove the back button and make a view slide up?
[英]UINavigation view with cancel button slide up
嗨,我正在構建一個應用程序,並且具有主UINavigation視圖。 我想在其中構建另一個部分,因此當您按下按鈕時,將從底部彈出一個新的UI NavigationVIew。 當您查看了幾個視圖時,可以單擊頂部的“取消”按鈕,並且UINavigationView向下滑動,然后返回到UINavigation View的原始頁面,單擊該按鈕。
我想構建一些功能類似於亞馬遜應用程序中的亞馬遜購物籃部分的東西。 任何想法如何做到這一點?
您需要一個模式視圖。 檢查UIViewController中的presentModalViewController
方法。
也許是這樣的:
-(void)viewDidLoad {
if(isViewPushed == NO){
self.navigationItem.leftBarButtonItem = [[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel_Clicked :)] autorelease]; }
-(void)viewWillAppear:(BOOL)動畫{
[super viewWillAppear:animated]; }
-(void)cancel_Clicked:(id)sender {
[self.navigationController dismissModalViewControllerAnimated:YES]; }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.