Android布局未正确显示

Android布局未正确显示,android,layout,Android,Layout,我将我的代码发布在下面,在下面的布局中,从顶部开始有一个空间显示在布局中。我只想删除顶部空间并尝试在顶部显示标题。但我不知道如何设置它。请给我建议解决方案。提前谢谢 XML文件 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="matc

我将我的代码发布在下面,在下面的布局中,从顶部开始有一个空间显示在布局中。我只想删除顶部空间并尝试在顶部显示标题。但我不知道如何设置它。请给我建议解决方案。提前谢谢

XML文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_gravity="top"
              android:orientation="vertical"
              android:weightSum="100">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/folder_name"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:paddingLeft="30dip"
            android:textSize="15dp"
            android:layout_weight="1"
            android:textColor="#115c28"/>

        <TextView
            android:id="@+id/folder_count"
            android:layout_width="0dp"
            android:layout_height="60dp"
            android:textSize="20dp"
            android:textStyle="bold"
            android:textColor="#115c28"
            android:gravity="center"
            android:paddingRight="30dip"
            android:paddingLeft="35dip"
            android:layout_weight="1" />
    </LinearLayout>

    <ListView
        android:id="@+id/folder_display_list"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>
</LinearLayout>

如果您只是询问顶部没有空格的两个文本对齐方式,那么下面的代码将适合您

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:weightSum="100">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="top"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/folder_name"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:layout_weight="1"
            android:gravity="top|center"
            android:textColor="#115c28"/>

        <TextView
            android:id="@+id/folder_count"
            android:layout_width="0dp"
            android:layout_height="60dp"
            android:textSize="20sp"
            android:textStyle="bold"
            android:textColor="#115c28"
            android:gravity="top|center"
            android:layout_weight="1" />
    </LinearLayout>

    <ListView
        android:id="@+id/folder_display_list"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>
</LinearLayout>

请检查
value
目录中
style.xml
文件中的边距值

它可能与主题参数一起使用。

xml

        <resources xmlns:android="http://schemas.android.com/apk/res/android">

        <!--
        Base application theme, dependent on API level. This theme is replaced
        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
        -->
        <style name="AppBaseTheme" parent="android:Theme.Light">
        <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
        -->
        </style>

        <!-- Application theme. -->
        <style name="AppTheme" parent="AppBaseTheme">
        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
        </style>

        <!--THIS ONE FOR THE CHANGE THE COLOR OF THE APPBAR STARTS  -->

        <style name="MyTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:actionBarStyle">@style/MyActionBar</item>
        </style>

        <style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
        <item name="android:background">#CECFCE</item>
        <item name="android:textAlignment">center</item>
        </style>


        <!--THIS ONE FOR THE CHANGE THE COLOR OF THE APPBAR STARTS  -->


        <!-- Theme : Green-->
        <style name="ThemeSelector" parent="android:Theme.Light">
        <item name="android:windowTitleStyle">@style/headerTextStyle</item>        
        <item name="android:windowBackground">@color/white</item>
        <item name="android:windowTitleSize">20dip</item>
        <item name="android:windowTitleBackgroundStyle">@style/WindowTitleBackground</item>
        </style>    

        <style name="headerTextStyle" >
        <item name="android:textSize">10sp</item>
        <item name="android:textColor">@color/black</item>
        <item name="android:paddingLeft">10sp</item>
        </style>


        <style name="WindowTitleBackground">     
        <item name="android:background">@color/light_grey</item>
        </style>

        <style name="myOptionMenu">     
        <item name="android:background">@color/white</item>
        <item name="android:textColor">@color/black</item>
        </style>

        <!-- color -->
        <color name="green">#05781e</color>
        <color name="white">#ffffff</color>
        <color name="black">#000000</color>
        <color name="red">#f71350</color>
        <color name="grey">#666666</color>
        <color name="light_grey">#bfbfbf</color>

        <!-- end -->

        </resources>

@样式/MyActionBar
#CECFCE
居中
@样式/标题文本样式
@颜色/白色
20度
@样式/窗标题背景
10便士
@颜色/黑色
10便士
@颜色/浅灰色
@颜色/白色
@颜色/黑色
#05781e
#ffffff
#000000
#f71350
#666666
#bfbfbf

你有你想要实现的屏幕头像吗?您好,我无法发布屏幕截图,问题是“布局”显示了名称,并且一个接一个地正确计数,但在操作栏上有顶部的空格。我想删除该空格请任何人告诉我解决方案。。。!上面的代码副本已粘贴,但显示与前面相同的op