Stas
Stas

Reputation: 1365

Android how can I create this thin gaps between buttons?

Take a look at action bar at this famous app. How can I create this thin gaps between buttons?

enter image description here

Upvotes: 1

Views: 409

Answers (4)

Mario Lenci
Mario Lenci

Reputation: 10542

first of all the source code of the IOschede application is open source so you can easily take a look inside it and understand how it works.

by the way here is a description of the problem and wich solution you can take, of course it all depends on whic is you minSdk attribute.

Android 3.0> with native ActionBar

if are talking about the native 3.0> ActionBar then take a look at this question.

you can use this attribute in your application style.

<item name="android:actionButtonStyle">@style/ActionButtonStyle</item>

and define the style here and place a custom 9patch background with a left vertical stripe

<style name="ActionButtonStyle" parent="@android:style/Widget.Holo.Light.ActionButton">
    <item name="android:background">@drawable/custom_bg</item>             
</style>

Android <3.0

you can either decide tu use ActionBarSherlock and solve all yours compatibility problem or take a look at the IOsched solution, if i'm not wrong they take the buttons style the same way it works for the native ActionBar with a application Theme attribute .

Upvotes: 0

Swayam
Swayam

Reputation: 16364

In the xml file that contains your buttons, specify android:layout_marginLeft / android:layout_marginRight (for the buttons) according to your need.

Upvotes: 0

Thkru
Thkru

Reputation: 4199

try in your xml the addtributes android:padding and android:margin when using a TableLayout or a GridLayout

Upvotes: 1

Md Abdul Gafur
Md Abdul Gafur

Reputation: 6201

In Android this Dashboard User Interface . please check out the link

I think it help you.

Thanks

Upvotes: 0

Related Questions