Jonathan Andersson
Jonathan Andersson

Reputation: 1057

not allowed to add android:windowTranslucentStatusbar to style file

I can't get my project to compile after adding the Item name="android:windowTranslucentStatus" to my theme, just adding it to my theme gives me an error telling me I need to target SDK version 19.

That's is perfectly OK however if I move my style to my values-v19 folder I get an error saying that android:windowTranslucentStatus can be found.

I'm not that experienced with android but isn't this the correct way to do it?

values/styles.xml error:
android:windowTranslucentStatus requires API level 19 (current min 14)  


values-v19/styles.xml error
Error: No resource found that matches the given name: attr 'android:windowTranslucentStatus'.

The parent for my theme is android:Theme.Holo.Light if that matters.

Upvotes: 0

Views: 3154

Answers (2)

Jonathan Andersson
Jonathan Andersson

Reputation: 1057

So I solved my problem, the problem wasn't with the code itself apparently i had the Module SDK (in Project Settings > Modules > Dependencies > My project in Android Studio) set to API 18.

Changing that to API 19 solved everything.

Upvotes: 4

androCoder-BD
androCoder-BD

Reputation: 516

so far I am concern this theming should be done within your androidMenifest file. Under each activity you can define the theme or if every activity shares the same theme then adding this under the application tag should be ok. However below is the code and this is how I get my work done.

 <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" >
    <activity
        android:name="com.aminoit.blogspot.notifyme.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

Upvotes: 0

Related Questions