0

我正在做一个 iphone 应用程序。在这个应用程序中,我想禁用后退 navigationleftbarbutton。我已经使用下面的代码来禁用navigationleftbarbutton,但它不起作用。现在我创建了一个视图,并添加了 uinavigationbar。但现在我想在透明视图中制作该视图。以及如何从导航栏中删除我的 customview(myview1)。我附上了我的代码。请一些人帮我解决我的问题。

禁用代码:

self.navigationItem.leftBarButtonItem setEnabled:NO];

这是我的自定义视图代码:

myview1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 40)];
myview1.backgroundColor = [UIColor redColor];
button = [[UIBarButtonItem alloc]initWithCustomView:myview1];
self.navigationItem.leftBarButtonItem = button;

我怎样才能让 myview 是透明视图。以及如何从导航栏中删除 mycustomview(myview1)。提前致谢。

4

1 回答 1

0

you can hide navigation back button by writing code below:

self.navigationItem.leftBarButtonItem.hidden = YES;

and your view ie myview can be transparent by changing alpha value of the view

[myview setAlpha:0.3];   //alpha value ranges from 0 to 1

By settign alpha value 0.0 makes view transparent and increases transparency as u increases alpha value

于 2012-12-30T08:11:46.033 回答