gpt4 book ai didi

java - 操作栏背景显示在屏幕中间

转载 作者:太空宇宙 更新时间:2023-11-04 15:10:42 26 4
gpt4 key购买 nike

我更改了操作栏的背景,但它看起来像这样:

(我无法发布图片,因为我的声誉不超过 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>

list :

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

最佳答案

您的操作栏样式可能没有被使用,因为您的主题没有链接到它,操作栏样式的父级也应该更改:

将其添加到您的 AppBaseTheme 中:

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

将操作栏样式声明更改为:

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

然后发布您的布局 xml,我们将看看是否可以进一步帮助您

关于java - 操作栏背景显示在屏幕中间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21365400/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com