Android 隐藏导航栏 滑动,怎样实现滑动时导航栏的隐藏android

2016-11-25 回答

(id)initwithrootviewcontroller:(uiviewcontroller *)rootviewcontroller

{

if (self = [super initwithrootviewcontroller:rootviewcontroller]) {

self.navigationbar.translucent = yes;

}

return self;

}

色调颜色

在我的 uiapplicationdelegate 的子类,我设置导航栏中的色调颜色。我发现色调颜色的 alpha 没有区别。也就是说,使用 alpha 0.1 不会导致要变得更透亮的栏。

(bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions

{

[[uinavigationbar appearance] settintcolor:[uicolor greencolor]];

}

边缘

在我的内容视图控制器中,我将设置边缘为 uirectedgenone 这样顶部的导航栏不会砍。如果要使用默认的 uirectedgeall ,导航栏将会永久地盖顶部的我的内容。即使我要住在一起这种异常, uirectedgeall 仍然不会启用半透明效果。

(void) viewdidload

{

[super viewdidload];

self.edgesforextendedlayout = uirectedgenone;

}

编辑: 试验与边缘

@rmaddy 在评论中所指出的广告问题可能与 edgesforextendedlayout。我发现综合教程 edgesforextendedlayout ,并试图实现它:

(void) viewdidload

{

[super viewdidload];

self.edgesforextendedlayout = uirectedgeall;

self.automaticallyadjustsscrollviewinsets = yes;

self.extendedlayoutincludesopaquebars = no;

}

它不工作。首先,那里是没有半透明效果。第二,我的内容的顶部被切掉。在上面的代码与以下示例页上,神通最初由导航栏和它是很难向滚动。你可以拉下,看到顶部的化身,但当你放开,页面会自动弹起来,神通将会再次被遮掩。

解决方法 1:

问题是由第三方拉下来刷新视图egorefreshtableheaderview,而普遍地使用了之前的 ios 6 介绍系统刷新控制引起的。

这种观点混淆了 ios 7,让它认为内容是比真的很高。ios 6 和

7,我已经有条件地切换到使用uirefreshcontrol。现在的导航栏不会砍掉我的内容。我可以使用 uirectedgeall

,使我下面的导航栏的内容走。最后,显示我的导航栏与较低的 α 要获得半透明效果色调图。

// mostly redundant calls, because they're all default

self.edgesforextendedlayout = uirectedgeall;

self.automaticallyadjustsscrollviewinsets = yes;

self.extendedlayoutincludesopaquebars = no;

[[uinavigationbar appearance] settintcolor:[uicolor colorwithwhite:0.0 alpha:0.5]];

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值