Carlos.V
Carlos.V

Reputation: 446

Image below action bar and for different screen sizes

any idea how can i implement this small spike under action bar and it can be in the same place for different screen sizes?

enter image description here

Upvotes: 1

Views: 121

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 363835

You can use a .png for different resolutions.

Otherwise you can build a triangle using a xml file.
Something like this:

 <?xml version="1.0" encoding="utf-8"?>
    <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
        <item >
            <rotate
                android:fromDegrees="45"
                android:toDegrees="45"
                android:pivotX="135%"
                android:pivotY="15%" >
                <shape
                    android:shape="rectangle"  >
                    <stroke android:color="@android:color/transparent" android:width="XXdp"/>
                    <solid
                        android:color="@color/mycolor"  />
                </shape>
            </rotate>
        </item>
    </layer-list>

Upvotes: 2

Related Questions