2014-01-26 34 views
1

我已經改變了操作欄的背景中,但它看起來像這樣:動作欄背景顯示在屏幕

(因爲我沒有超過10聲譽,我不能張貼圖片)

我有股票操作欄,我的操作欄背景顯示在屏幕中間。我不知道我怎麼能更好地描述它。

你知道是什麼問題?

這裏是我的styles.xml:

<?xml version="1.0" encoding="utf-8"?> 
<resources> 

    <!-- 
     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> 

    <style name="ButtonBar"> 
     <item name="android:paddingLeft">2dp</item> 
     <item name="android:paddingTop">5dp</item> 
     <item name="android:paddingRight">2dp</item> 
     <item name="android:paddingBottom">0dp</item> 
     <item name="android:background">@android:drawable/bottom_bar</item> 
    </style> 

    <style name="ActionBar" parent="AppTheme"> 
     <item name="android:background">@drawable/action_bar</item> 
    </style> 

</resources> 

清單:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.geniboys.sosyaaal" 
    android:versionCode="1" 
    android:versionName="1.0" > 

    <uses-sdk 
     android:minSdkVersion="11" 
     android:targetSdkVersion="19" /> 

    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_icon" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:name="com.geniboys.sosyaaal.loginActivity" 
      android:label="@string/app_name" 
      android:screenOrientation="portrait" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name="com.geniboys.sosyaaal.DisplayMessageActivity" 
      android:label="@string/title_activity_display_message" 
      android:screenOrientation="portrait" > 
     </activity> 
     <activity 
      android:name="com.geniboys.sosyaaal.SignUpActivity" 
      android:label="@string/title_activity_sign_up" 
      android:screenOrientation="portrait" > 
     </activity> 
     <activity 
      android:name="com.geniboys.sosyaaal.SignUp2" 
      android:label="@string/title_activity_sign_up2" 
      android:screenOrientation="portrait" > 
     </activity> 
     <activity 
      android:name="com.geniboys.sosyaaal.LogoActivity" 
      android:configChanges="orientation|keyboardHidden|screenSize" 
      android:label="@string/title_activity_logo" 
      android:theme="@style/FullscreenTheme" 
      android:screenOrientation="portrait" > 
     </activity> 
    </application> 

</manifest> 

和layout.xml

<RelativeLayout xmlns:tools="http://schemas.android.com/tools" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    android:background="@drawable/loginbackground" 
    tools:context=".loginActivity" > 

    <TextView 
     android:id="@+id/textView2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/textView1" 
     android:layout_marginTop="22dp" 
     android:layout_toLeftOf="@+id/textView1" 
     android:text="@string/loginEmail" 
     android:textAppearance="?android:attr/textAppearanceMedium" 
     android:textColor="#ffffff" /> 


    <TextView 
     android:id="@+id/textView3" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/textView2" 
     android:layout_marginTop="16dp" 
     android:layout_toLeftOf="@+id/textView1" 
     android:text="@string/loginSifre" 
     android:textAppearance="?android:attr/textAppearanceMedium" 
     android:textColor="#ffffff" /> 

    <EditText 
     android:id="@+id/editText1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignBottom="@+id/textView2" 
     android:layout_alignLeft="@+id/textView1" 
     android:ems="10" 
     android:inputType="textEmailAddress" 
     android:text="@string/loginEmailhint" 
     android:textColor="#ffffff" > 

    </EditText> 

    <EditText 
     android:id="@+id/editText2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignBottom="@+id/textView3" 
     android:layout_alignLeft="@+id/editText1" 
     android:ems="10" 
     android:inputType="textPassword" 
     android:textColor="#ffffff" /> 

    <Button 
     android:id="@+id/button1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/textView3" 
     android:layout_marginTop="26dp" 
     android:layout_toRightOf="@+id/textView3" 
     android:text="@string/loginGiris" 
     android:textColor="#ffffff" /> 

    <Button 
     android:id="@+id/button2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignBaseline="@+id/button1" 
     android:layout_alignBottom="@+id/button1" 
     android:layout_toRightOf="@+id/button1" 
     android:onClick="kayitOl" 
     android:text="@string/loginKayit" 
     android:textColor="#ffffff" /> 

    <TextView 
     android:id="@+id/textView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_centerHorizontal="true" 
     android:layout_centerVertical="true" 
     android:text="@string/loginSenKimsin" 
     android:textAppearance="?android:attr/textAppearanceLarge" 
     android:textColor="#ffffff" /> 

</RelativeLayout> 

回答

0

你的動作條的風格可能是心不是被用作您的主題不鏈接到它,在動作條的風格父母也應該改變:

添加這個您AppBaseTheme內:

<item name="android:actionBarStyle">@style/ActionBar</item> 

更改操作欄樣式聲明:

<style name="ActionBar" parent="android:Widget.ActionBar"> 

然後發表您的佈局XML,我們會看到,如果我們可以幫助您進一步

+0

謝謝對於幫助,現在它不顯示在屏幕中間,但操作欄的背景不會改變。順便你想讓我發佈哪種佈局? – Senhor

+0

佈局取其活動正顯示出這種怪異的行爲,再加上明顯的pelase –

+0

添加你想要 – Senhor