首页 文章 精选 留言 我的

精选列表

搜索[箭头样式],共7775篇文章
优秀的个人博客,低调大师

Android - toolbar navigation 样式

1.修改title 边距 修改边距使用系统的app属性来引入使用,即: xmlns:app="http://schemas.android.com/apk/res-auto" 1 比如: <android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="1dp" android:background="?attr/colorPrimary" android:minHeight="?attr/actionBarSize" android:orientation="vertical" app:contentInsetLeft="10dp"/> 当然也可以在style.xml中修改,自己研究吧; 2.修改navigation icon的padding值 修改padding值,就需要在style.xml中修改;在此我们修改的是navigation的pading值: Widget.AppCompat.Toolbar.Button.Navigation 比如: 1.定义style <style name="myToolbarNavigationButtonStyle" parent="@style/Widget.AppCompat.Toolbar.Button.Navigation"> <item name="android:minWidth">0dp</item> <item name="android:padding">@dimen/margin_horizontal_large</item> <item name="android:scaleType">centerInside</item> </style> 1 2.app主题中应用 <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="toolbarNavigationButtonStyle">@style/myToolbarNavigationButtonStyle</item> </style> 1 3.title居中 toolbar是可以自定义布局的,可以在toolbar中添加一个textview来实现,从而代替title;比如: 1.布局 <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" ​ android:layout_height="?actionBarSize" android:background="@null" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" app:theme="@style/AppTheme"> <TextView android:id="@+id/toolbar_title" style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"/> </android.support.v7.widget.Toolbar> 2.初始化 View v = findViewById(R.id.toolbar); if (v != null) { toolbar = (Toolbar) v; setSupportActionBar(toolbar); toolbarTitle = (TextView) v.findViewById(R.id.toolbar_title); if (toolbarTitle != null) { getSupportActionBar().setDisplayShowTitleEnabled(false); } } 3.使用 设置title两种方式: (1)直接在setText(); (2)在AndroidManifest.xml中指定title; (3)如果有baseActivity的话,解决如下: Activity有一个onTitleChanged的接口,在Activity的onPostCreate与setTitle中都会调用这个方法; protected void onPostCreate(@Nullable Bundle savedInstanceState) { if (!isChild()) { mTitleReady = true; onTitleChanged(getTitle(), getTitleColor()); } mCalled = true; } 所以只需要在BaseActivity中重载这个方法就行了,如下所示 : @Override protected void onTitleChanged(CharSequence title, int color) { super.onTitleChanged(title, color); if (toolbarTitle != null) { toolbarTitle.setText(title); } } 参考资料 - 点我 4.修改menu的padding值 定义style值: <style name="mToolbarStyle" parent="@style/Widget.AppCompat.Toolbar"> <item name="android:paddingRight">0dp</item> <item name="android:paddingLeft">13dp</item> </style> 1 使用: <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="1dp" android:background="?attr/colorPrimary" android:minHeight="?attr/actionBarSize" android:orientation="vertical" style="@style/mToolbarStyle"/> 1 上面的方法,在有些机子上会失效,大家有上面办法,请告诉我,谢谢! 5.参考 修改toolbar的一些属性toolbar学习使用 本文转自 一点点征服 博客园博客,原文链接:http://www.cnblogs.com/ldq2016/p/7233440.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

基于Leaflet和天地图的直箭头标绘实战-源码分析

在博客中介绍过geoman标绘的具体实现,使用Leaflet GeoMan结合天地图进行自由标绘实战,基于GeoMan的标绘只能包含了常见的点、线、面、矩形的空间对象的标绘。在一些面向特种行业的应用中,我们会遇到特种标绘。比如用来表示敌我双方态势的战斗标绘,比如在一场战斗中的敌我接敌,各方的支援力量的介入,战斗的结果等等过程需要进行集中的标绘。如下图所示:

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册