1

The icon and title in the action bar of my app are very close together and don't look nice. I want to give space between the two. I searched and got an answer from an older question number 21578528 answer being 'actionBar.setTitle...'

I applied it, but got no result.

public class MainActivity extends ActionBarActivity {
Button mButton;
public static String glossary=null;
public static String txid=null;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ActionBarActivity actionBar=new ActionBarActivity();
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setIcon(R.drawable.purseicon4848);
    actionBar.setTitle("  "+"myTitle");
Bojan Kseneman
  • 15,488
  • 2
  • 54
  • 59
user3144078
  • 145
  • 2
  • 9
  • You can use a custom style for your actionbar, check this question/answer: http://stackoverflow.com/questions/9737101/padding-between-actionbars-home-icon-and-title – zkminusck May 10 '15 at 09:29

1 Answers1

0

On using the following line it helped me: getSupportActionBar().setTitle(" "+"myTitle");

user3144078
  • 145
  • 2
  • 9