Shivam Bhalla
Shivam Bhalla

Reputation: 1909

Android how to achieve 3d like action bar in play books app

I am looking to implement a 3d like ActionBar shown here. Here there is thin dark blue line below the actual ActionBar. How do i implement that?

enter image description here

Upvotes: 0

Views: 295

Answers (2)

adneal
adneal

Reputation: 30804

You could achieve this using a couple of different methods.

Use a View

You could add a View that rests at the top of your layout, or just below the ActionBar then set its background accordingly.

Apply it directly to the ActionBar

  1. Apply it via code: To apply the image via code, see ActionBar.setBackgroundDrawable
  2. Apply it via style: If you'd like to apply it via a style, refer to the official Android guide on Styling the ActionBar

Creating the Drawable

As far as the effect you're looking for goes, I think you want something like this: action-bar-bg

That was created using Photoshop and the 9-Patch generator in the SDK tools. You could also use the Simple Nine Patch Generator to create one.

Upvotes: 1

Kuffs
Kuffs

Reputation: 35661

See documentation here

https://developer.android.com/training/basics/actionbar/styling.html

Just apply the style you wish to use to the relevant part of the action bar.

Upvotes: 0

Related Questions