android沉浸式标题栏
来源:互联网 发布:手机淘宝店怎样发货 编辑:程序博客网 时间:2024/05/18 15:29
android沉浸式标题栏
1:设置样式1 values - styles.xml:<resources> <style name="BaseAppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">#FF4081</item> <item name="colorPrimaryDark">#FF4081</item> <item name="colorAccent">#FF4081</item> </style> <!-- Base application theme. --> <style name="AppTheme" parent="@style/BaseAppTheme"> </style></resources>2:设置样式2 values - v19 - styles.xml:<resources> <!-- Base application theme. --> <style name="AppTheme" parent="@style/BaseAppTheme"> <item name="android:windowTranslucentStatus">true</item> </style> <!-- <item name="android:windowTranslucentNavigation">true</item>--></resources>3:activity布局activity_main.xml:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/id_main_content" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.v7.widget.Toolbar android:id="@+id/id_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#FF0000" android:fitsSystemWindows="true"<!--一定要写,不然为白色--> app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> <TextView android:id="@+id/id_tv_content" android:layout_width="match_parent" android:layout_height="50dp" android:gravity="center" android:text="HelloWorld" android:background="#FF0000" android:textSize="30sp" /></LinearLayout>4:activity:public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.id_toolbar); toolbar.setTitle("标题栏"); setSupportActionBar(toolbar); }}5:效果图:
1 0
- android沉浸式标题栏
- Android 沉浸式标题栏
- android状态栏标题栏的沉浸式模式
- Android 标题栏沉浸式的实现
- android沉浸式状态栏、fitsSystemWindows、标题栏折叠
- Android标题栏沉浸效果
- 沉浸式标题栏样式
- 沉浸式标题栏
- Android沉浸式(侵入式)标题栏(状态栏)Status(一)
- Android沉浸式(侵入式)标题栏(状态栏)Status(二)
- Android沉浸式(侵入式)标题栏(状态栏)Status(三)
- Android沉浸式(侵入式)标题栏(状态栏)Status(一)
- Android沉浸式(侵入式)标题栏(状态栏)Status(二)
- Android沉浸式(侵入式)标题栏(状态栏)Status(三)
- Android 安卓 自定义标题栏+沉浸式状态栏
- Android沉浸式标题栏迄今为止最完美的解决方案
- Android 沉浸式标题栏的快速实现方式
- Android UI 之自定义标题栏 + 沉浸式状态栏
- UVa12118:Inspector's Dilemma
- 怎样设计一个运行日志服务
- 基于rails的schedule网站开发(4):git 存档记录
- HDU 1035 机器人行走步数 (模拟)
- Linux 的 时间
- android沉浸式标题栏
- Ant-wiki.com 关于我们
- 安卓通过意图使系统安装apk
- 10012---JavaScript--类型转换
- Valid Parentheses
- C - Sum It Up hdu1258
- GNU C 的一大特色就是__attribute__ 机制
- js----显示当前系统时间
- [学习]JavaScript设计模式——Revealing Module(揭示模块)模式