android 尺寸工具栏,如何更改android顶部工具栏菜单项图标大小

如何更改

android工具栏中菜单项的大小?目前菜单的尺寸非常小,我想增加尺寸.如果有人知道请帮我找到解决方案.

app_bar.xml

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:background="@color/primaryColor"

android:minHeight="?attr/actionBarSize"

android:paddingTop="@dimen/app_bar_top_padding"

android:theme="@style/ToolBarStyle"/>

Styles.xml

@color/primaryColor

@color/primaryColorDark

@color/accentColor

@color/primary_high_light

#ffffff

menu_option.xml

xmlns:app="http://schemas.android.com/apk/res-auto">

android:title="homes"

android:icon="@drawable/ic_action_home1"

app:showAsAction="always"/>

android:title="ProfilePreview"

android:icon="@drawable/profile"

app:showAsAction="always"/>

android:title="findPeople"

android:icon="@drawable/ic_action_search1"

app:showAsAction="always"/>

android:title="log"

android:icon="@drawable/ic_action_logout1"

app:showAsAction="always"/>

MainActivity.java

public boolean onCreateOptionsMenu(Menu menu) {

MenuInflater inflater = getMenuInflater();

inflater.inflate(R.menu.menu_option, menu);

return true;

}

@Override

public boolean onOptionsItemSelected(MenuItem item) {

switch (item.getItemId()) {

case R.id.profilepreview:

startActivity(new Intent(this, ProfilePreview.class));

return true;

case R.id.homes:

mFragment = new HomeFragment();

break;

case R.id.findPeople:

mFragment = new FindFriendsFragment();

break;

case R.id.log:

M.logOut(this);

mIntent = new Intent(this, LoginActivity.class);

finish();

}

if (mFragment != null && mIntent == null) {

mFragmentManager = getFragmentManager();

mFragmentManager.beginTransaction()

.replace(R.id.frameContainer, mFragment).commit();

} else {

startActivity(mIntent);

mIntent = null;

}return super.onOptionsItemSelected(item);

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值