Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何删除自定义选项卡视图的底线_Android - Fatal编程技术网

Android 如何删除自定义选项卡视图的底线

Android 如何删除自定义选项卡视图的底线,android,Android,如何从选项卡视图中删除该行?或者我可以为其设置高度或颜色吗?尝试在windowContentOverlay设置为空时定义新主题: <style name="MyTheme" parent="@android:style/Theme> <item name="android:windowContentOverlay">@null</item> </style> 然后将此主题应用于清单中的活动,或者您可以将其应用于元素以在应用程序范围内应用它

如何从选项卡视图中删除该行?或者我可以为其设置高度或颜色吗?

尝试在windowContentOverlay设置为空时定义新主题:

<style name="MyTheme" parent="@android:style/Theme>
    <item name="android:windowContentOverlay">@null</item>
</style>
然后将此主题应用于清单中的活动,或者您可以将其应用于元素以在应用程序范围内应用它:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.stylingandroid.VectorDrawables" android:versionCode="1"
    android:versionName="1.0">
    <uses-sdk android:minSdkVersion="10" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".MainActivity"
            android:label="@string/app_name" android:theme="@style/MyTheme">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>
这应该可以消除阴影


如果您想更改它的颜色,请在样式中设置android:cacheColorHint。

查看此帖子:我已经检查过了。问题正在发生。我在哪里使用android:cacheColorHint?你能给我举个例子吗还有一件事,灰色背景显示在取消选择的选项卡底部。如何更改或删除它?如果您希望以与android:windowContentOverlay项目相同的方式实际查看它,请使用00000000或其他颜色。您关于灰色背景的问题最好作为单独的问题提问。另外,提供一个与本问题中的屏幕截图类似的屏幕截图,以便准确显示您所指的内容。