自定义 actionbar 两边有空隙问题
来源:互联网 发布:java nested查询 编辑:程序博客网 时间:2024/05/02 00:00
http://www.aichengxu.com/other/3372571.htm
http://www.cnblogs.com/his365/p/6078093.html
主要代码:
@Override
protectedvoid onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.sliding_menu_content);
myApplication =(MyApplication) getApplication();
mContext =this;
mActionBar = getSupportActionBar();
View actionbarView=LayoutInflater.from(this).inflate(R.layout.actionbar_layout,null);
ActionBar.LayoutParams layoutParams=newActionBar.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT,
ActionBar.LayoutParams.MATCH_PARENT);
layoutParams.gravity =Gravity.CENTER_HORIZONTAL|Gravity.CENTER_HORIZONTAL;
mActionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
mActionBar.setDisplayShowHomeEnabled(false);
mActionBar.setDisplayShowCustomEnabled(true);
mActionBar.setDisplayShowTitleEnabled(false);
mActionBar.setCustomView(actionbarView, layoutParams);
Toolbar parent =(Toolbar) actionbarView.getParent();
parent.setContentInsetsAbsolute(0,0);
}
}
阅读全文
0 0
- 自定义 actionbar 两边有空隙问题
- 解决自定义actionbar 两边空隙
- android 解决自定义actionbar左右两边有间距问题记录
- Android 自定义Toolbar/ActionBar视图左右两边有空白
- 自定义对话框两边有间距问题
- img之间有空隙的问题
- 解决UINavigationController 自定义LeftBarButtonItem左边空隙问题
- 自定义actionbar 问题
- actionbar默认两边有边距
- 自定义toolbar左右两边空白的问题
- 取消NavigationBar左右两边的空隙
- Android SeekBar去掉左右两边空隙
- Android SeekBar去掉左右两边空隙
- 基线问题以及块级转化内联有空隙问题
- IMG与元素边界有空隙问题分析及解决
- ListBox Dock Fill 总是有空隙的问题
- 【Android】自定义标题栏 (解决了标题栏两侧空隙问题)
- ActionBar解决出现两边或者四周出现黑条的问题
- 10.数据平滑处理
- cocos2dx 在 Mac 下创建 lua 工程总结
- adaboost的python代码实现
- 非空判断
- 卷积(通俗解释)
- 自定义 actionbar 两边有空隙问题
- TP5 基础说明
- LabVIEW 程序的内存优化
- 34嘻刷刷
- Android 实现圆角按钮(selector和shape的简单用法)
- Linux 的crontab定时任务进行接口调用
- Rotate List
- BigDecimal和NumberFormat四舍五入的区别
- vue编程式导航