我得到我的周圍自定義標題欄,這是我不希望的邊緣的黑色邊框。任何想法都會很棒。這是標題欄的代碼。
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="35sp"
android:gravity="center_vertical"
android:background="@color/TitleBlue">
<ImageView
android:id="@+id/header"
android:src="@drawable/app_icon_white"
android:adjustViewBounds="true"
android:layout_marginLeft="5sp"
android:layout_marginBottom="1sp"
android:padding="3sp"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<com.hdms.manager.Drawable.TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:text="HDMS Manager"
android:textColor="@android:color/white"
android:textStyle="bold"/>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="right">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/circleIcon"
android:src="@drawable/blank_circle"
android:adjustViewBounds="true"
android:layout_marginLeft="-8sp"
android:padding="8sp"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<com.hdms.manager.Drawable.TextView
android:id="@+id/accessLevel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/circleIcon"
android:layout_alignTop="@+id/circleIcon"
android:layout_marginLeft="14sp"
android:layout_marginTop="8sp"
android:text=""
android:textColor="@color/TitleBlue" />
</RelativeLayout>
<ImageView
android:id="@+id/connectionModeIcon"
android:src="@drawable/direct_on_lan"
android:adjustViewBounds="true"
android:layout_marginLeft="-8sp"
android:padding="8sp"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
<ImageView
android:id="@+id/connectedIcon"
android:src="@drawable/tick_raw"
android:adjustViewBounds="true"
android:layout_marginLeft="-8sp"
android:padding="8sp"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
</LinearLayout>
</LinearLayout>
我使用自定義的TextView,以便我可以將自己的TTF加載到項目中。但這不是問題,因爲邊界仍然存在於正常的TextView中。
這是清單文件。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hdms.manager"
android:versionCode="12"
android:versionName="0.35" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:name="App"
android:theme="@style/AppTheme" >
<!-- Splash screen -->
<activity
android:name="com.hdms.manager.Drawable.SplashScreen"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Main activity -->
<activity
android:name="com.hdms.manager.MainActivity"
android:label="@string/app_name" >
</activity>
</application>
</manifest>
而且從styles.xml
<!-- Application theme. -->
<style name="AppTheme" parent="android:Theme.Light">
<item name="android:windowTitleSize">35sp</item>
<item name="android:dropDownListViewStyle">@style/MyDropDownListView</item>
<item name="android:buttonStyle">@style/My.Button</item>
</style>
顏色相關的代碼從colors.xml
<color name="TitleBlue">#008cb8</color>
的問題,如果顏色設置爲黑色的是沒有看到。
你如何在你的主佈局中包含這個標題欄xml? –
發佈您的自定義標題欄的'AndroidMenifest.xml'和'resources'。 –
使用全屏幕 – Rohit