0

I want to create a custom action bar like this picture. actionbar

enter image description here

now how to use repeated image for bottom border of action bar?

curiousMind
  • 2,812
  • 1
  • 17
  • 38

1 Answers1

0

I don't think repeated image for the bottom border is a good idea. You need to find that image background and set background like that: Is there a way to set actionbar backgound by image in android?

If you still want repeated image for the bottom border, you can create a LinearLayout in the bottom custom action bar and add image view like this:

  LinearLayout lnlContainer = (LinearLayout) findViewById(R.id.lnl_container);

   for (int i = 0; i<10;i++){
                ImageView imagView = new ImageView(YourAcitivty.this);
                imagView.setImageResource(R.drawable.your_image_bg);
                lnlPhotosContainer.addView(imagView);
            }
Community
  • 1
  • 1
Hoang Nguyen
  • 141
  • 1
  • 8
  • so what is the best image size for action bar bottom border? – user2782614 Mar 08 '16 at 08:22
  • It is up to you. How many image you want to create for the bottom border? You can get the screen size and divide by the number of images. You will get the width of the image view and set the height of the image view you want. – Hoang Nguyen Mar 08 '16 at 10:38