【问题标题】:Android ActionBar Background ImageAndroid ActionBar 背景图片
【发布时间】:2014-09-02 09:47:07
【问题描述】:

我可以为操作栏设置背景图像,但不适合图像的大小吗?我想设置背景并使图像适合操作栏大小。我该怎么做?

【问题讨论】:

标签: android android-actionbar background-image image-size


【解决方案1】:
 final ActionBar actionBar = getActionBar(); 

 BitmapDrawable background = new BitmapDrawable (BitmapFactory.decodeResource(getResources(),   
 R.raw.actionbar_background)); 

 background.setTileModeX(android.graphics.Shader.TileMode.REPEAT); 

 actionBar.setBackgroundDrawable(background);

See this

【讨论】:

  • 新 BitmapDrawable (BitmapFactory.decodeResource(getResources(), R.raw.actionbar_background));已弃用
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-01-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多