2016-12-26 5 views
0

Ich poste meinen Code unten, im folgenden Layout gibt es einen Platz von oben im Layout angezeigt. Ich möchte nur den oberen Platz entfernen und versuchen, Titel oben anzuzeigen. Aber ich bin verwirrt, wie man es setzt. Bitte schlagen Sie mir Lösung vor. Vielen Dank im Voraus.Android Layout nicht richtig angezeigt

XML Datei

<?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> 
+1

Haben Sie eine screencap von dem, was Sie erreichen wollen? –

+0

Hallo, ich bin nicht in der Lage, den Screenshot zu posten, Problem ist, dass Layout zeigt den Namen und zählt richtig nacheinander, aber von der Aktionsleiste gibt es den Raum von oben. Ich möchte diesen Raum entfernen –

Antwort

0

, wenn Sie nur über die beiden Textausrichtung auf, ohne Raum fragen als unten Code für Sie von Ihrem

<?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> 
+0

gleichen o/p gezeigt..! –

+0

über Code kopiert eingefügt, aber zeigt die gleiche op wie vorherige –

0

Bitte überprüfen Sie die Randwerte funktionieren style.xml Datei im Verzeichnis values.

Es könnte mit Ihren Theme-Params besetzt sein.

+0

bitte jemand sagt mir Lösung ...! –

0

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> 
Verwandte Themen