goweii / actionbarex Goto Github PK
View Code? Open in Web Editor NEW高拓展高自定义性ActionBar,完美替代Android系统默认
Home Page: https://github.com/goweii/ActionBarEx
License: GNU Lesser General Public License v3.0
高拓展高自定义性ActionBar,完美替代Android系统默认
Home Page: https://github.com/goweii/ActionBarEx
License: GNU Lesser General Public License v3.0
ActionBarCommon比之前的Simple左边的返回图标小了一圈,应该是所有的图标都小了一圈,期望更改
设置为false,标题栏还是会多出来一块布局
3.0.0及以后的版本没有SimpleActionBar了,引入后找不到该自定义的view,但是readme文档中还有。请更新
报错信息:Process: com.pasaruang.pinjaman.dana.tunai.uang.loan, PID: 32523
java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class androidx.appcompat.widget.Toolbar$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/action_bar. Make sure other views do not use the same id.
复现步骤:开发者模式中设置不保留活动以模拟内存不足被回收的状态->主页中的头部用的per.goweii.actionbarex.common.ActionBarCommon ,然后主页随便跳转一个页面,再点击返回到主页->主页重建->奔溃
关键点:action_bar.xml 中的android:id="@+id/action_bar"
原因:暂未查明
导入框架的时候都没问题,都导入成功了,但是在运行的时候,一直提示我找不到me.zhanghai.android.materialprogressbar.MaterialProgressBar,不知道是缺了什么?然后我不得已删了这个前景层...就出现了ActionBar和状态栏重叠的情况,头疼,希望能早点解决
设置状态字体颜色后,ActionBarCommon会往下移
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
请问如果不调用此方法,如何修改状态栏颜色?
ActionBarCommon 可以加一个 titleTextStyle 属性吗,需要设置标题加粗
我看了下发现好像只可以获取上面的数据,好像不能自定义动态修改
actionBarCommon.getRightTextView().setText不能动态设置文字吗?
如果要自定义ActionBar的背景呢?要让背景显示一个图片呢?要让图片延伸到状态栏下面呢?要让背景实现半透明高斯模糊效果呢?要限定按钮图标的大小呢?要自定义中间标题的背景呢?要显示一个搜索框呢?要让搜索框带有清空和搜索图标呢?要自定义搜索框样式呢?要在网络请求时显示一个Loading效果呢?
现在官方文档里面是推荐使用Toolbar
取代ActionBar
的,Toolbar
就可以实现你说的这些了啊
让背景显示图片
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/white" // 可以直接设置背景图
app:contentInsetStart="0dp">
// 或者在这里用ImageView
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@mipmap/ic_launcher"
android:scaleType="centerCrop"
/>
</androidx.appcompat.widget.Toolbar>
Toolbar
里面不仅可以放ImageView
,还可以放RelativeLayout
之类的布局,这些实现起来就更没问题了
要自定义中间标题的背景呢?要显示一个搜索框呢?要让搜索框带有清空和搜索图标呢?要自定义搜索框样式呢?
至于
要让背景实现半透明高斯模糊效果呢
这个就不应该是一个导航栏应该考滤的了吧,应该是ImageView
的事了
还有
要在网络请求时显示一个Loading效果呢?
在布局里面加一个进度条就好了啊
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.