no,title
来源:学生作业帮助网 编辑:作业帮 时间:2024/09/24 18:27:23 字数作文
篇一:Android开发教程去掉标题栏和全屏
本文由麦可网cocos2d-x开发/course/19 收集整理,转载请注明出处。
Android开发教程去掉标题栏和全屏
Android去掉标题栏和全屏都是件很容易的事情,最常见的有两种方法:
第一:在程序代码中实现
Java代码
Java代码
? this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏
? this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏
?
? this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏
? this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏
注意:这两行代码要写在页面显示之前,即setContentView(R.layout.XXX)之前
第二:在AndroidManifest.xml配置文件中实现标签android:theme
Java代码
XML/HTML代码
1. 2. android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> 3. 4. 5. android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> 注意:如果不需要全屏,只需要写成android:theme="@android:style/Theme.NoTitleBar即可 总结:二者的区别 如果使用第一种方法,在Activity启动时会有短暂的标题栏和信息栏的出现,随后会消失。 使用第二种方法这不会出现这种情况,个人推荐使用第二种方式,看起来比较流畅。 篇二:称谓翻译(Name&Title) 机 关 部 门 及 处 室 总经理工作部:General Management Department ? ? ? ? ? ? ? 人事董事部:Personnel & Director Department ? ? ? 安全监察部:Safety Supervision Department ? ? 保卫部:Security Department ? 人力资源部:Human Resource Department ? ? ? ? 综合处 Multiple Affairs Section 劳动组织处 Manpower Organization Section 劳动力处 Labour Force Section 工资奖励处 Salary & Bonus Section 保卫处 Security Guard Section 综合处 Multiple Affairs Section 电网安全处 Network Safety Section 领导干部处 Headship Section 机关人事处 Internal Personnel Section 董事监事与综合处 Director Supervision & Multiple Affairs Section 秘书处 Secretariat Section 综合处 Multiple Affairs Section 文书处 Amanuensis Section 国际合作处 International Cooperation Section 接待处 Reception & Service Section 档案馆 Document Catalogue Section 政策法律事务室 Policy & Law Affairs Section ? ? ? ? ? ? 教育培训处 Education & Training Section 专业技术技能处 Professional Technique Section 社保中心 Public Insurance Centre 保险政策处 Insurance Policy Section 保险帐户与信息处 Insurance Account & Information Section 综合保险基金处 Multiple Insurance Fund Section 电力工会:Trade Union ? ? ? ? 发展策划部: Developing & Planning Department ? ? ? ? 思想政治工作部:Political Affairs Department ? ? ? ? 审计部:Auditing Department ? ? 营销部:Sale Department 经营与综合审计处 Management & Multiple Audit 投资与合同审计处 Investment & Contract Audit 组织处 Organization Section 宣传处 Propaganda Section 团 委 Youth League Committee 新闻中心 News Centre 发展规划处 Development & Plan Section 基建投融资处 Infrastructure Investment & financing 经营管理处 Sales & Administration 计划统计处 Plan & Statistics 办公室 General Affairs Section 生产保护部 Workforce Protection Section 宣教文体部 Propaganda, Education & Culture Section 女工生活部 Female Service Section ? ? ? ? ? ? 营销处 Sales Section 市场处 Marketing Section 信息处 Information Section 稽查处 Check 农电营销处 Rural power sale 综合处 Multiple Affairs Section 机关工作部:Internal Affairs Department ? ? ? ? ? 财务部:Department of Finance ? ? ? ? ? ? 纪 委:Discipline Inspection Committee ? ? ? 离退休工作部:Retirement Affairs Department ? ? 综合处 Multiple Affairs Section 老干部处 Retire Cadre Section 一室 Unit 1 二室 Unit 2 三室 Unit3 会计与预算处 Accounting & Budgeting Section 资金资产处 Funding & Asset Section 投融资处 Investment & Finance Section 价格与税收处 Price & Tax Section 财务稽查与评价处 Finance check & evaluation 综合处 Multiple Affairs Section 综合处 Multiple Affairs Section 财务处 Finance Section 内保处 Internal Security Section 机关党委 Party Committee 机关车队 Transportation Section 生产技术部:Product & Technique Department ? ? ? ? 科技信息部:Scientifical & Technological Information Department ? ? 基本建设部:Fundamental Construction Department ? ? ? ? 基建办公室:Infrastructure Office 调度中心:Power Dispatching Centre ? ? ? ? ? ? ? 农电工作部:Rural Power Department ? 生产技术处 Production technology 调度处 Dispatch Section 继电保护处 Relay Protection Section 运行方式处 Mode Operation Section 自动化处 Automation Section 市场交易处 Marketing Trade Section 技术管理处 Technology Administration Section 综合处 Multiple Affairs Section 综合处 Multiple Affairs Section 计划经营处 Plan & Sale Section 招投标处 Bidding & Receiving 工程处 Section of Project Management 科技环保处 信息处 电网处 Network Section 配电处 Distribution Section 企业管理处 Enterprise Administration Section 综合处 Multiple Affairs Section ? ? 计划基建处 Fundamental Construction Planning Section 综合处 Multiple Affairs Section 综合产业部:Multiple Industry Department ? 经营管理处 Management administration ? 综合处 Multiple Affairs Section 篇三:自定义 titlebar 自定义titlebar,去除边缘阴影 修改前 修改后 跟android:windowContentOverlay 属性有关。 可以通过这样的方法去掉titlebar 就不会有上述的问题了。 首先在style.xml里定义一个notitlebar的style 然后在AndroidMainfest.xml中相应的activity中做配置 引用该style 1、利用Activity的requestWindowFeature方法激活window features。再通过window的setFeatureInt方法设定事先定义好的布局文件。 具体代码如下: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); // 这里要主要requestWindowFeature和setContentView先后顺序哦 setContentView(R.layout.custom_title); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title); } custom_title为自定义的标题栏布局文件。 2、通过在manifest文件中设置需要自定义标题栏的Activity的主题。如下: android:name=".main.About" android:label="@string/about" android:theme="@style/MyCustom"> android:name=".main.Help" android:label="@string/help" android:theme="@style/MyCustom"> 在res/values/styles.xml文件中定义好自己的样式: 设置标题栏的背景色和高度 虽然我们可以通过自定义布局文件在标题栏加入一些控件,但是仍然不能改变标题栏的高度、背景色,要想达到这个目的,只能使用theme(主题)。 \res\values\style.xml: =============================================================================== =窗体显示状态操作(requestWindowFeature()的应用) 首先介绍一个重要方法那就是requestWindowFeature(featrueId),它的功能是启用窗体的扩展特性。参数是Window类中定义的常量。 一、枚举常量 1.DEFAULT_FEATURES:系统默认状态,一般不需要指定 2.FEATURE_CONTEXT_MENU:启用ContextMenu,默认该项已启用,一般无需指定。 3.FEATURE_CUSTOM_TITLE:自定义标题。当需要自定义标题时必须指定。如:标题是一个按钮时 4.FEATURE_INDETERMINATE_PROGRESS:不确定的进度 5.FEATURE_LEFT_ICON:标题栏左侧的图标 6.FEATURE_NO_TITLE:没标题 7.FEATURE_OPTIONS_PANEL:启用“选项面板”功能,默认已启用。 8.FEATURE_PROGRESS:进度指示器功能 9.FEATURE_RIGHT_ICON:标题栏右侧的图标 比较常用的FEATURE_INDETERMINATE_PROGRESS和FEATURE_NO_TITLE。 F EATURE_INDETERMINATE_PROGRESS:表示一个进程正在运行 progress.xml android:layout_height="wrap_content"> android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" style="?android:attr/progressBarStyleSmallTitle"> Java代码 publicvoid onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setContentView(R.layout.main); getWindow().setFeatureInt(Window.FEATURE_INDETERMINATE_PROGRESS, R.layout.progress); setProgressBarIndeterminateVisibility(true); //适当时候set false来隐藏 //... } 标题进度条显示 FEATURE_NO_TITLE 就是不显示标题栏,某些时候全屏需要,但全屏不等于不显示标题栏,我尝试显示标题栏的同时全屏来去掉系统的状态栏: Java代码 publicvoid onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.main); //自定义标题栏 mWindow = getWindow(); mWindow.setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.titlebar); /* full screen */ mWindow.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); // ... } 所以真正实现全屏的是后面的那句话! 效果图 ====================================================================怎么在4.0及以上系统中自定义TitleBar 本文将通过一个实例讲解怎么实现在4.0及以上系统版本中实现自定义TitleBar,这只是我自己找到的一种方法; xml布局文件 文件里一定要加入 tools 那两句,否则出错。 activity_main.xml 篇四:Latex命令大全+QA tex提供300多条基本排版命令 由D.E.Knuth1978年开发 plain tex:在tex基础上新定义600多条复合命令 AMS-TEX:美国数学会开发(amsmath宏包)排版的数学公式 LATEX:L.Lamport(1985)编写,适合排版普通文章和书籍 LATEX2e:可加载amsmath宏包,目前最流行的TEX宏包 版本:LATEX2.09-->LATEX2e-->LATEX3(开发中) 中文排版: CCT:科学院张林波 TY(天元):华师大肖刚、陈志杰教授开发 CJK:德国W.Lemberg开发,处理中日韩三国文字。 发行版CTEX:集成了CCT,TY,CJK的MikTEX系统。 ChinaTEX:内容涵盖MiKTeX系统及中文支持、常用外围软件、TeX\LaTeX文档和模板选萃等 TeX中的长度 mm毫米 cm厘米 in英寸=2.54cm=72.27pt pt点 em大写字母M的宽度 ex小写字母x的高度 弹性长度:根据需要自动伸缩 正常值plus伸展值minus收缩值 实际长度可超过正常值和伸展值之和,但不能小于正常值和收缩值之差 \documentclass[11pt]{article}%11pt字体,普通文章 %导言区,全局命令 \usepackage{CJK}%使用CJK宏包 \begin{document}%主环境 \begin{CJK}{GBK}{song}%汉字必须放入CJK环境 %其它字体:song,kai,fs,hei,li,you %CJK的两种环境CJK和CJK* %GBK是采用的字符集:GB,GBK,Bg5,Gbt Hi,This is my first \LaTeX file 祝贺你,MikTex和CJK安装成功了 \end{CJK} \ent{document} CJK和CJK*环境之间的切换 \CJKspace和\CJKnospace \CJKtilde 重新定义~的长度 基本约定 分组{......} 注释符:% 西文标点后要加空格 各种环境的开始和结束命令最好独占一行 换行:连续两个回车,一个仅为空格 输入特殊字符 前加\的有:#$%{}~_^& \=\textbackslash |,<,>=$|$,$<$,$>$,$*$(中间星) *=*上面星 特殊符号\s \p \dag \ddag \copyrigh版权号,\pounds 磅 \TeX \LaTeX \LaTeXe \AmS-\LaTeX(最后这个要amsmath宏包) 单引号:`'(1键前面的) 双引号:``" +------------------------------+ |段落、行距、水平间距、缩进命令| +------------------------------+ 强制分行:\\或\\*[和下行间距离]、\newline 建议分行:\linebreak[0-4,数越大建议力度越大] \linebreak增加字间距,强制换行 \nolinebreak[n]建议不分行 \mbox{内容}内容保持在同一行 分段:\par,或两个回车 分页:自动分页 强制分页:\newpage 建议分页:\pagebreak[n],\nopagebreak[n] 增加当前页高度有时可以避免难看的分页 \enlargethispage{尺寸}可增加的最大高度 \enlargethispage*{尺寸}指定增加高度 水平间距: \quad 插入空白相当于当前字体大小 \qquad=\quad×2 \ ,=\quad×3/18 ~=???好象比\ 小 \hspace{宽度大小},\hspace*{宽度大小} \hfill弹性长度:hspace{\hfill}插入空白,撑满整行 \hphantom{文本内容},占据文本内容的宽度 \vphantom[文本内容},\phantom{文本内容} 导引线:\dotfill,\hrulefill 垂直间距: \vspace{高度}和\vspace*{高度} \vfill:相当于\vspace{\fill} \smallskip:-->\vspace{\smallskipamount} \medskip:-->\vspace{\medskipamount} \bigskip:-->\vspace{\bigskipamount} 段落首行缩进: \setlength{\parindent}{2em},2个M \setlength{\parindent}{0pt},首行不缩进 \CJKindent:两个汉字 \indent与\noindent 每节的第一段首行不会自动缩进 \hspane{\parindent} 在导言区加入:\usepackage{indentfirst} 段落间距:\lineskip+\parskip 可用\setlength修改以上值 行距: \baselineskip:相邻两行基线间距离 \baselinestretch:伸展因子 修改改变行距:\renewcommand{\baselinestretch}[1.2] 放在\begin{document}之后,字体尺寸改变时才生效 +----------------------------------+ |西文字体属性、及中文字体属性、命令| +----------------------------------+ 字体有5种属性 族: \rmfamily:罗马字体 \sffamily:无衬线字体 \ttfamily:打字机字体 形状:(shape)直立斜 \upshape:直立 \itshape:意大利斜体 \slshape:斜体 \scshape:小体大写 系列:(series)宽(转 载于:wWw.SmHaIDA.cOM 海达 范文 网:no,title)度黑度 \mdseries:中等权重(黑) \bfseries:粗体 \normalfont:默认字体,中等权重直立罗马字体 西文尺寸:10pt,11pt,12pt \em强调,一般为斜体 以上命令称为声明(无参数) 每一声明对应字体命令 命令只对其参数中的文本起作用 族: \testrm{},\testsf{},\testtt{} 形状 \textup{},\textit{},\textsl{},\textsc{} 系列 \textmd{},\textbf{} 默认值:\textnormal{} 强调:\emph{} 定义了基本尺寸后,可使用下面的声明来改变字体 \tiny 5pt \scriptsize 7pt \footnotesize 8pt \small 9pt \normalsize 10pt \large 12pt \Large 14.4pt \LARGE 17.28pt \huge 20.74pt \Huge 24.88pt 以上尺寸是基本尺寸为10pt时的大小 所有西文字体命令对中文同样起作用 italic和slanted斜体对中文一样 中文书籍基本字号为5号约等于11pt 使用GBK编码时,可同时输入简繁体。 自定义字体大小 \fontsize{字体尺寸}{行距}后面须加上\selectfont才生效 可得到任意大小汉字,西文最大不能超\Huge 行距通常为字体大小的1.2-1.5倍 例:\fontsize{12pt}{\baselineskip}\selectfont \usepackage{type1cm}任意大小西文 行距:\linespread{1.3}产生1.5倍行距,1.6产生双倍行距,效果夸张,不适合出版 用下面方法:\setlength{\baselineskip}{1.5\baselineskip}{......} 正文中更换字体:\CJKfamily{字体族} 为方便,作以下自定义 \newcommand*{\SONG}{\CJKfamily{song}} \newcommand*{\HEI}{\CJKfamily{hei}} \newcommand*{\KAI}{\CJKfamily{kai}} \newcommand*{\FS}{\CJKfamily{fs}} \newcommand*{\LI}{\CJKfamily{li}} \newcommand*{\YOU}{\CJKfamily{YOU}} 引用更改为宋体:\SONG 正文 文本居中 文本默认为左对齐 单行文本居中命令 \centerline{....} 多行使用\begin{center}环境 居中声明:\centering(不建议使用) +------------+ |参考文献环境| +------------+ \begin{thebibliography}{编号样本} \bibitem[记号]{引用标志} 文献条目 . . . 篇五:Android 全屏的两种方法 [Android]设置Activity为全屏显示的两种方法 1. 方法1:AndroidManifest.xml 里,Activity的 android:theme 指定为" :style/Theme.NoTitleBar.Fullscreen" 示例: android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme=" :style/Theme.NoTitleBar.Fullscreen"> android:name=".MainActivity"> 2. 方法2: 在onCreate()里指定No title 要加入: /*set it to be no title*/ requestWindowFeature(Window.FEATURE_NO_TITLE); /*set it to be full screen*/ getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 示例: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /*set it to be no title*/ requestWindowFeature(Window.FEATURE_NO_TITLE); /*set it to be full screen*/ getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_main);