【问题标题】:Android-How do I change the size of the ActionBarDrawerToggle Icon?Android-如何改变ActionBarDrawerToggle Icon的大小?
【发布时间】:2018-10-19 11:33:37
【问题描述】:

我想让 ActionBarDrawerToggle(Hamburger) 图标更大。

我尝试过改变条形的宽度,但无法改变。

我该怎么办?

【问题讨论】:

  • 在这里分享您的代码。
  • @VedPrakash 问题已解决,谢谢

标签: android


【解决方案1】:

试试这个:

for (int i = 0; i < mToolbar.getChildCount(); i++) {
   if(mToolbar.getChildAt(i) instanceof ImageButton){
       mToolbar.getChildAt(i).setScaleX(1.5f);
       mToolbar.getChildAt(i).setScaleY(1.5f);
   }
}

【讨论】:

【解决方案2】:

添加到 Yaw 的答案中。

你应该这样写:

toolbar.post(new Runnable() {
@Override
public void run() {
        for (int i = 0; i < toolbar.getChildCount(); i++) {
            if(toolbar.getChildAt(i) instanceof ImageButton){
                toolbar.getChildAt(i).setScaleX(1.5f);
                toolbar.getChildAt(i).setScaleY(1.5f);
            }
        }
    }
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-10-08
    • 2018-10-27
    • 1970-01-01
    • 2019-04-18
    • 1970-01-01
    • 1970-01-01
    • 2020-05-04
    • 1970-01-01
    相关资源
    最近更新 更多