开发者

Remove default drop shadow at top of activity layout?

开发者 https://www.devze.com 2023-01-21 06:52 出处:网络
I have an activity. It does not have a title bar. The content view is just a linear layout. It looks like android draws a drop shadow at the top of my content view, directly below the status bar. Is t

I have an activity. It does not have a title bar. The content view is just a linear layout. It looks like android draws a drop shadow at the top of my content view, directly below the status bar. Is there a way to stop that from being drawn?

My layout is just:

<LinearLayout ... />

I have no titlebar:

requestWindowFeature(Window.FEATURE_NO_TIT开发者_如何学GoLE);

Thanks.


In res/values/styles.xml:

<style name="Theme.Custom" parent="@android:style/Theme.NoTitleBar">
    <item name="android:windowContentOverlay">@null</item>
</style>

Then in your manifest:

<activity android:name=".YourActivity" 
    android:theme="@style/Theme.Custom" >
...
</activity>


In res/values/styles.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Theme.Custom" parent="@android:style/Theme.NoTitleBar">
        <item name="android:windowContentOverlay">@null</item>
    </style>
</resources>
0

精彩评论

暂无评论...
验证码 换一张
取 消