- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我很困惑,在不同的文档中,导航栏指的是不同的控件,但在这里,它是Android功能,除了硬件按钮之外还提供导航控件。我希望得到这个条宽码的高度。
在挖掘了永久隐藏栏的解决方案后,我意识到这是不可能的(这是解决问题的最理想的方法),如果可以永久隐藏栏,请纠正我!我在此处附加了我用来隐藏该栏的代码,但每当我点击屏幕时,该栏就会重新出现。
相反,我可以获取Android上底部软件导航栏的高度,以便我可以相应地调整页面元素的位置吗?(更令人烦恼的是,某些 Android 设备允许用户通过单击栏上的箭头按钮来手动显示和隐藏栏。)
//In OnCreate of MainActivity.cs,
int uiOptions = (int)Window.DecorView.SystemUiVisibility;
uiOptions |= (int)SystemUiFlags.HideNavigation;
Window.DecorView.SystemUiVisibility = (StatusBarVisibility)uiOptions;
//In some topics, people said to add some more SystemUiFlags, such as IMMERSIVE_STICKY, LAYOUT_FULLSCREEN, but with those, the bar cannot be hidden.
奇怪的是,DeviceDisplay.MainDisplayInfo.Height 包括导航栏的高度,否则我不需要执行上述操作。有没有一种方法可以在没有软件导航栏的情况下检测屏幕高度?
非常感谢您对此提供的任何帮助。
PS:除了获取高度之外,我至少可以检测软件导航栏是否打开/显示吗?!现在我知道我可以使用 ViewConfiguration.Get(Android.App.Application.Context).HasPermanentMenuKey 检测设备是否有硬导航键,这很有用,但我仍然无法检测软导航栏是否打开。
最佳答案
关于在xamarin.form中获取导航栏高度,您可以尝试使用:
TypedArray styledAttributes = this.Theme.ObtainStyledAttributes(new int[] {Android.Resource.Attribute.ActionBarSize });
var actionbarHeight = (int)styledAttributes.GetDimension(0, 0);
styledAttributes.Recycle();
Console.WriteLine("the height is {0}",actionbarHeight);
关于android - 如何在Xamarin.Form应用程序中获取Android底部软件导航栏的高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57170764/
前言 在进行Maven开发时,往往需要下载大量jar包,而由于网络不稳定等其他因素可能导致jar未下载完毕,然后保留了lastUpdated文件,导致无法更新失效的jar包。 本文分享 bat脚本,自
按字母顺序排序并不是我们花太多时间担心的事情。我们在很小的时候就学习了字母表,现在我们知道它(拉丁文)以 A 开头,然后是 B,然后是 C 等等,一直到 Z。 但是这个订单究竟存储在计算机系统中的什么
我尝试使用可分离为 2 个一维向量的二维矩阵来证明二维傅里叶变换的信号属性的可分离性。地点: f(x,y) = f(x)*f(y) 那么 F(u,v) = F(u)*F(v) 使用以下代码: % Se
我需要为几个小型sqlite数据库编写文档。想描述数据的使用方式,包括表和行说明以及示例数据。 是否可以使用MySQL Workbench?如果没有其他选择,或者我可以使用任何模板? TIA! 最佳答
我正在尝试使用旧版本(例如:1.4.5)安装 memcached,但我不知道该怎么做。 brew install memcached安装最新的。 我也试过 brew install memecache
背景 多年来,我一直使用自己的类似贝叶斯方法,根据大型且不断更新的训练数据集对来自外部来源的新项目进行分类。 每个项目都有三种类型的分类: 30 个类别,其中每个项目必须属于一个类别,且最多属于两个类
嗨,我需要确定 4 个数字是否相等。数字是 size(A,1)、size(B,1)、size(C,1) 和 size(D,1),其中,例如A = [1 2; 3 4], B=[1 2 3, 4 5 6
Wikipedia 中的文章似乎太冗长了。 我将框架理解为一组精心设计的库和工具。 Qt 框架为跨平台 GUI 提供了一组库/工具。 cocoa 框架为 Mac 做了同样的事情。 软件框架的实际定义是
我们的客户最近发现了这个网站: http://mydeco.com/3d-planner/ 它有一个非常非常奇特且组合良好的 3d CAD Web 应用程序,似乎是使用 jQuery 编写的,而不是
我们正在寻找一种独立的(非 cms)日历解决方案来显示在网络上。它可以是开源的或付费服务。 我们主要是在寻找一种在 Web 上显示日历的方法,其中包含事件发生的时间和事件的名称。如果它可以按周、月、年
我想知道与软件相关的“质量保证”和“质量科学”之间的区别。 我在Google上进行了研究,但未找到有关“质量科学”的任何信息。 最佳答案 Based on the link you have prov
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,
我有一个由 2 个方程和 2 个未知数组成的系统,我想使用 MATLAB 求解,但不知道如何编程。我得到了一些有关 Gamma 分布的信息(平均值为 1.86,90% 的间隔介于 1.61 和 2.1
给定一个矩阵,其中 1 是当前子集 test = 0 0 0 0 0 0 0 0 0 0 0 0
我在组合 Matlab“数据”变量的重复元素时遇到问题。我可以使用 unique 和 sort 轻松组合这些值。 [sorted,idx] = sort(data); [~,ij] = unique(
我在做的问题中有这么一段代码,如下图。定义部分只是为了向您展示数组的大小。下面我粘贴了矢量化版本 - 它慢了 2 倍以上。为什么会这样?我知道如果矢量化需要大的临时变量,我就会发生,但(看起来)这里不
我有一个 3D 矩阵,我想将它的每个 2D 分量存储在另一个 2D 矩阵的行中,该 2D 矩阵有许多行作为 3D 矩阵的第 3 维。 我该怎么做? 最佳答案 与 permute & reshape -
如果计算机能够使用纯 JavaScript(Google V8)、C++(Windows、Mac OS 和 Linux)运行程序/软件而没有任何性能问题,是否有任何好的方法可以通过要求尽可能少尽可能从
我的团队的任务是将用于播放媒体文件的全屏、信息亭式应用程序从 Windows 迁移到嵌入式 ARM Linux(瘦客户端)。我们需要在 sd/1080p 中支持 mpeg-2 播放以及 HTML、SW
我们有数以千计的具有白色或黑色或渐变背景的产品图片。我们正在寻找可以去除图片背景的软件或服务。我们需要一款能够很好地完成这项工作的智能软件。 最佳答案 在 photoshop 中,您可以记录 Acti
我是一名优秀的程序员,十分优秀!