Android:屏幕顶部的不需要的白盒子(工具栏?)

Android:屏幕顶部的不需要的白盒子(工具栏?),第1张

概述如何摆脱android视图顶部的白框?我在代码中看不到任何地方,我调用了创建工具栏的东西,也没有自己编写代码.它也存在于视图之上,而不是在视图中.我猜在xml文件的设计视图中有一些设置可以切换它吗?提前致谢!**我还应该包括它仅适用于此活动,而我的其他活动顶部没有此白条.此外, *** 作栏

如何摆脱android视图顶部的白框?我在代码中看不到任何地方,我调用了创建工具栏的东西,也没有自己编写代码.它也存在于视图之上,而不是在视图中.我猜在xml文件的设计视图中有一些设置可以切换它吗?提前致谢!

**我还应该包括它仅适用于此活动,而我的其他活动顶部没有此白条.此外, *** 作栏是白色汽车上方的细蓝色条,因此任何涉及 *** 作 *** 作栏的代码都不会更改白条的状态. **

编辑:XML代码如下

<?xml version="1.0" enCoding="utf-8"?><relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    androID:background="@drawable/bucket"    androID:theme="@+ID/Buckettheme2"    androID:backgroundTint="#70FFFFFF"    androID:backgroundTintMode="src_over"><tableLayout    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent">    <tableRow>        <TextVIEw            androID:ID="@+ID/textVIEw"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_weight="1"            androID:gravity="center"            androID:paddingBottom="5dp"            androID:paddingtop="100dp"            androID:text="Find a place to go around you!"            androID:textcolor="#ff000000"            androID:textSize="18dp" />    </tableRow>    <tableRow        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent">        <button            androID:ID="@+ID/button"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_weight="1"            androID:gravity="center"            androID:onClick="randombuttonpressed"            androID:text="RANDOMIZE"            androID:textSize="20dp" />    </tableRow>    <tableRow        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent">        <button            androID:ID="@+ID/bucketBtn"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_weight="1"            androID:gravity="center"            androID:onClick="bucketbuttonpressed"            androID:text="Bucket List"            androID:textSize="20dp" />    </tableRow>    <tableRow        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent">        <button            androID:ID="@+ID/searchLocationBtn"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:layout_weight="1"            androID:gravity="center"            androID:onClick="searchbuttonpressed"            androID:text="Search by Location"            androID:textSize="20dp" />    </tableRow></tableLayout></relativeLayout>

编辑2:Buckettheme2的style.xml代码如下(我最初没有发布,因为它只设置颜色):

<style name="Buckettheme2" parent="androID:theme.Holo.light.DarkActionbar">    <item name="colorPrimary">@color/colorPrimary</item>    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>    <item name="colorAccent">@color/colorAccent</item></style>

解决方法:

在Manifest.xml中为应用程序或活动设置主题以删除 *** 作栏:

androID:theme="@androID:style/theme.Holo.light.NoActionbar"

或者在onCreate方法的Activity中添加以下代码并导入androID.support.v7.app.Actionbar:

Actionbar actionbar = getSupportActionbar();actionbar.hIDe();
总结

以上是内存溢出为你收集整理的Android:屏幕顶部的不需要的白盒子(工具栏?)全部内容,希望文章能够帮你解决Android:屏幕顶部的不需要的白盒子(工具栏?)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1119984.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-29
下一篇2022-05-29

发表评论

登录后才能评论

评论列表(0条)

    保存