0

I'm trying to set the background of the actionbar to be transparent

Is it possible? if possible can someone show me how?

Here are my codes:

public class MainMenu extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ActionBar actionbar = getSupportActionBar();
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_main_menu);
        LinearLayout v = (LinearLayout) findViewById(R.id.layout);
        //v.setBackgroundColor(0xffECECEC);
        v.setBackgroundResource(R.drawable.background);

        actionbar.setDisplayShowTitleEnabled(false);
        actionbar.setDisplayShowHomeEnabled(false);

        LayoutInflater mInflater = LayoutInflater.from(this);
        View mCustomView = mInflater.inflate(R.layout.action, null);
        TextView mTitleTextView = (TextView) mCustomView.findViewById(R.id.actiontitle);
        mTitleTextView.setText("HADI");

        actionbar.setCustomView(mCustomView);
        actionbar.setDisplayShowCustomEnabled(true);

        BitmapDrawable background = new BitmapDrawable (BitmapFactory.decodeResource(getResources(), R.drawable.actionbar)); 
         background.setTileModeX(android.graphics.Shader.TileMode.REPEAT); 

         actionbar.setBackgroundDrawable(background);

    }
Sam M
  • 159
  • 1
  • 3
  • 12

1 Answers1

0

fixed by setting the alpha in actionbar style

Sam M
  • 159
  • 1
  • 3
  • 12