首页 技术 正文
技术 2022年11月7日
0 收藏 494 点赞 737 浏览 1665 个字

以前的我是没有做笔记的习惯的,学习了后觉得自己能记住,但是最近发现很多学的东西都忘记了,所有现在一有新的知识,就记下来吧。

最近又做一个mono for android 的项目 这次调整比较大,上次做的点餐系统很好用 ,但是做的时候没有做笔记很多东西都忘记了,这次我把项目涉及到的知识传到博客上,方便记忆,也很大家分享分享的,希望大家能给出点意见。

在value里面新建 mystyle.xml

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="CustomWindowTitleBackground">
<item name="android:background">#565656</item>
</style> <style name="test" parent="android:Theme">
<item name="android:windowTitleSize">40dp</item>
<item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
</style>
</resources>

在Layout里面新建布局myTitle.axml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#f5f5f5"
>
<LinearLayout
android:id="@+id/mytitlebar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
>
<ImageView
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/Logo"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="彩云"
android:textSize="32sp"
/>
</LinearLayout>
</LinearLayout>

在activity中先加入样式 Theme = “@style/test”
[Activity(Label = “Cloud”, MainLauncher = true, Icon = “@drawable/icon”, Theme = “@style/test”)]

再替换掉原有的titleBar

 // 设置我自己的titleBar
//声明使用自己的的ActionBar
this.RequestWindowFeature(WindowFeatures.CustomTitle);    //设置布局 !注意顺序
SetContentView(Resource.Layout.Main);
//设置titleBae
SetTitle(Resource.Layout.myTitle);
Window.SetFeatureInt(WindowFeatures.CustomTitle, Resource.Layout.myTitle);
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,082
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,557
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,406
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,179
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,815
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898