我正在为学校项目制作Android应用程序(API 19),并且应用程序主体的顶部被标题遮住。在this picture你可以看到我正在尝试做什么。完全消除标题也可能是可取的(这里:android:theme =“@ android:style/Theme.Black.NoTitleBar”似乎没有任何效果)。标题与Android应用程序的主应用程序主体重叠
这里是我的代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#707070"
android:orientation="vertical"
android:theme="@android:style/Theme.Black.NoTitleBar"
tools:context=".FullscreenActivity" >
<!-- this is here only to display the first line correctly (zero container)-->
<LinearLayout
android:layout_width="match_parent"
android:gravity="right"
android:layout_height="50dp" >
<!--some functionality was necessary to avoid warnings-->
<TextClock
android:id="@+id/textClock1"
android:layout_gravity="right|center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/textClock" />
</LinearLayout>
<!-- this is the first container -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp" >
<!-- this is the heart rate interval progress bar -->
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1.06" />
<!-- this is a blue heart icon -->
<ImageButton
android:contentDescription="@string/heartIcon"
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/button_heart_blue" />
</LinearLayout>
<!-- code omitted -->
</LinearLayout>
我不愉快的“解决方案”,我想出了。有没有更清晰的方法来编写这个功能?
我将不胜感激任何帮助!谢谢!
你有没有检查我的回答 – kId
是的,它的工作!谢谢! – GiannisKuopio