我有一个UIImageView。我想添加一个trans
inCallBackGroundImgae = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"caller_texture.png"]];
[inCallBackGroundImgae setFrame:CGRectMake(0,top, self.view.frame.size.width, 250)];
[self.view addSubview: inCallBackGroundImgae];
我想添加一个透明视图,我在其中添加一个红色。我不想要导航栏我想添加透明视图
提前致谢
答案 0 :(得分:0)
请做这个
<application
android:name=".XXXXXX"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/app_theme" > //here
答案 1 :(得分:0)
hide navigation bar
viewDidLoad method
这样
[self.navigationController.navigationBar setHidden:YES];
现在添加透明UIView
代替navigationBar
UIView *transparentView = [[UIView alloc] initWithFrame:CGRectMake(0,0, self.view.frame.size.width, 64)];
transparentView.alpha = 0.33f;
[self.view addSubview: transparentView];
编辑:调整图像视图框,因为无法看到透明视图。
CGRect imgViewRect = inCallBackGroundImgae.frame;
imgViewRect.origin.y = 64;
imgViewRect.size.height = decrease height here if necessary
inCallBackGroundImgae.frame = imgViewRect;