0

I'm new in Android. I have two questions:

I have an application with a first Login view and some others view.

I would like to set an image as background for all views except the login view. Is there a way to set this background view in some way or do I need to have an ImageView into every layouts?

Is it possible to have the action bar partially transparent? I would like to overlap the action bar on the background image into every view.

Is possible to have an ActionBar with customized height? I would like to have an action bar thinner but not completely on top (I would not want it to start from y = 0) Is this possible?

Fizz Binn
  • 115
  • 1
  • 8
Safari
  • 11,437
  • 24
  • 91
  • 191

1 Answers1

0

For background image, you can set your default app theme with a background. /res/values/styles.xml

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="android:windowBackground">@drawable/bg_orange</item>
</style>

You can set your default theme for the whole application in AndroidManifest file with application tag.

Then you create another style for login activity and set the theme from AndroidManifest > activity tag for login.
http://developer.android.com/guide/topics/ui/themes.html

For ActionBar I'm not sure you can change the height, you may need to use a custom action bar implementation for that.

You may want to check this resources for custom action bar implementations,
Custom actionbar layout with overflow menu
Android ActionBar custom layout styling
How can I implement custom Action Bar with custom buttons in Android?

You can change the style of ActionBar, you can give a background color with alpha and use windowActionBarOverlay property for the Action Bar style.
https://developer.android.com/training/basics/actionbar/overlaying.html
Transparent Actionbar: custom tabcolor

Community
  • 1
  • 1
Ugur
  • 1,679
  • 14
  • 20
  • Also this might be helpful for styling Action Bar, [http://jgilfelt.github.io/android-actionbarstylegenerator/](http://jgilfelt.github.io/android-actionbarstylegenerator/) – Ugur Feb 27 '15 at 01:42