Android:自定义标题栏
来源:互联网 发布:crm软件系统ppt 编辑:程序博客网 时间:2024/06/10 11:38
现在很多的Android程序都在标题栏上都显示了一些按钮和标题,这里尝试做个实例
在onCreate中添加:
//自定义标题requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);setContentView(R.layout.main);//设置标题为某个layoutgetWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.titlebar);
布局文件:
<pre name="code" class="html"><?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/back" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="上一步" android:textSize="18sp"/> <TextView android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="标题" android:textSize="18sp" android:gravity="center" /> <Button android:id="@+id/back" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="下一步" android:textSize="18sp"/></LinearLayout>为避免冲突,修改:AndroidManifest.xml
<pre name="code" class="html">android:theme="@style/mystyle"
style
<pre name="code" class="html"><style name="mystyle" parent="android:Theme"><item name="android:windowTitleSize">50dp</item></style>
0 0
- android自定义标题栏progressBar
- Android自定义标题栏
- 自定义android标题栏
- android实现自定义标题栏
- Android自定义标题栏
- Android 自定义标题栏
- Android 自定义标题栏
- Android自定义标题栏
- Android自定义标题栏
- android之自定义标题栏
- Android自定义标题栏
- Android 自定义标题栏运用
- Android 自定义标题栏
- android ListView+自定义标题栏
- Android 自定义标题栏
- Android:自定义标题栏
- Android Actionbar自定义标题栏
- 自定义Android标题栏TitleBar
- android 特殊用户通知用法汇总--Notification源码分析
- Map.Entry
- matlab图像边缘检测
- 设计模式C++迭代器模式
- HDOJ 1431-素数回文【删除大量无关数据】
- Android:自定义标题栏
- spring笔记
- myeclipse和svn通过代理方式更新代码
- 赶集网mysql开发36军规
- 共同学习Java源码--常用数据类型--String(八)
- linux下安装jdk
- aop
- Linux下安装ActiveMQ CPP
- 【BZOJ2103】【BZOJ2447】Fire 消防站【DFS】【TreeDP】