Android 设置Activity全屏显示,没有TitleBar;自定义TitleBar

【Bugly安卓开发干货】Android APP 快速 Pad 化实现 Bugly 技术干货系列内容主要涉及移动开发方向,是由 Bugly 邀请腾讯内部各位技术大咖,通过日常工作经验的总结以及感悟撰写而成,内容均属原创,转载请标明出处。如何能在最快的时间内,实现一个最新版本 android app 的 pad 化呢?从拿到一个大型手机 app 代码开始开发到第一个其全新 pad 版本的发布,我们用了不到3个月时间给出了一份满意的答案。项目背景采用最新版本手机 APP(之 阅读详情

在setContentView(R.layout.main);前加入如下两行代码:

getWindow().setFlags(WindowManager.LayoutParam.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

requestWindowFeature(Window.FEATURE_NO_TITLE);


自定义TitleBar:

1、styles.xml加入如下:

  <style name="CustomWindowTitleBackground">
        <item name="android:background">@drawable/titlebackground</item>
    </style>
    
<style name="CustomTheme" parent="android:Theme">  
<item name="android:windowTitleSize">40dip</item>  
<item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
<!--  <item name="android:background">@drawable/titlebackground</item>-->
</style>  

2、编辑title.xml的布局文件:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="fill" >
   
<Button
   android:id="@+id/TitleHomeBtn"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_alignParentRight="true"
   android:layout_marginTop="9dp"
   android:background="@drawable/img67"
   android:gravity="center" />


<Button
   android:id="@+id/TitleBackBtn"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_alignParentLeft="true"
   android:layout_alignTop="@+id/TitleHomeBtn"
   android:background="@drawable/img64" />


<TextView
   android:id="@+id/Titletext"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_alignTop="@+id/TitleHomeBtn"
   android:layout_centerHorizontal="true"
   android:gravity="center_horizontal"
   android:textColor="#ffffffff"
   android:textSize="18sp"
   android:textStyle="bold" />


</RelativeLayout>

   

3、Activity中加入如下代码:

setTheme(R.style.CustomTheme);

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);

getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title);


台达PLC DIAdesigner-AX 编程笔记 1、登陆台达思图软件网站,选择Download,登陆注册好的账号,下载DIAInstaller,下载后安装(安装目录不要修改); 阅读详情

相关推荐

zabbix监控深信服下一代防火墙配置

深信服下一代防火墙v8.0管理界面,zabbix,SNMP

weixin_43996471的博客 6873

android studio的activity不显示标题栏

<application android:allowBackup="true" android:icon="@mipmap/blue" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@android:style/Theme.NoTitleBar.Fullscr.

tang13257662538的博客 3282

OpenIddict实战:5步搞定.NET Core应用的OIDC单点登录集成

本文详细介绍了如何使用OpenIddict在.NET Core应用中快速实现OIDC单点登录集成。通过五个关键步骤,包括环境准备、数据库集成、客户端注册、令牌配置和多应用SSO集成,帮助开发者高效构建安全的企业级单点登录解决方案。

lambda的博客 728

Android-关于activity不显示标题栏的笔记

这里写自定义目录标题关于activity不显示标题栏的笔记初始的AndroidManifest内容修改后的AndroidManifest注意在activity对应的java文件中要匹配主题 关于activity不显示标题栏的笔记 初次接触Android,有很多都不清楚,所以做个笔记记录一下学到的知识。这篇文章是关于Android中不显示标题栏的操作方法。 初始的AndroidManifest内容 ...

Mysterious_X的博客 1818

手把手教你搞定爱思唯尔LaTeX投稿:从模板到PDF生成的全流程避坑指南

本文详细介绍了使用LaTeX投稿爱思唯尔期刊的全流程避坑指南,包括模板选择、文件结构规范、投稿系统文件上传策略、PDF生成与检查等关键步骤。特别强调了避免常见错误如宏包冲突、图片丢失和参考文献问题,并提供了投稿后的应急方案和高阶自动化校验脚本,帮助研究者顺利完成投稿。

weixin_42525289的博客 512

ESP-IDF的安装及其在VScode中编译环境的搭建

从安装目录的\Espressif\frameworks\esp-idf-v5.3.2\examples路径中拷贝一个工程到项目中,比如拷贝\get-started下的hello_world文件夹。安装时可能会遇到如下问题,提示:"e:\ssc\software\ESP-IDF\v5.3.2\Espressif\tools\idf-python\3.11.2\python.exe -m pip" is not valid. (ERROR_INVALID_PIP)接着等待安装完成即可,其他步骤同方式1。

Freddy_Ssc的博客 4373

android为什么没标题栏了,本人新建的Activity为什么没有标题栏

新建个项目,选择EmptyActivity,然后本人又添加一个Activity,但是没有标题栏,怎么回事。就在本人发这个贴的时候,本人又rebuild了一下项目,现在两个activity都没标题栏了。蛋疼!android:layout_width="match_parent"android:layout_height="match_parent">android:layout_w...

weixin_29882269的博客 531

声音编程(Voice Coding) Talon(一) 基本介绍与安装使用

语音编程平台简介 语音编程工具有哪些:Talon是一款声音编程平台,它追求的意义在于完全取代键盘和鼠标。。当前,全球有两个领先的语音编程平台(Programming-By-Speech Platforms)。一是Serenade,它的作用有点像数字助手,可以让你描述正在编程的命令,而不要求你必须逐字逐句地口述每条指令。另一个就是Talon,它提供了对每一行代码更精细的控制,这也意味着你需要对每一个被编入机器的任务有更细致的把握。具体的差别可以参考文章末尾的Serenade 和 Talon编程的例子。 除了这

yinglang19941010的专栏 4139

android 标题栏无,android使所有 activity 全屏显示无标题栏无 Activity 栏_android_开发99编程知识库...

我需要删除所有 activity 中的动作栏/标题栏。 目前我应用android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"但这只从 Manifest 文件中删除,但这只从主中删除,其他 Activity 保持不变。 任何解决方案Activity 下的完整代码:android:name="com.dss.ms.Mai...

weixin_33267830的博客 3536

【AUTOSAR-IpduM】-3.1-配置一个发送Tx Dynamic Container PDU(Multiple-PDU)

手把手教您如何配置一个Tx Dynamic Container PDU(Multiple-PDU),动态容器复用帧。并附上测试LOG帮助您进一步加深理解。

「汽车电子助手」的博客 1771

【车载以太网】【架构】整体架构与协议标准

车载以太网架构图 应用层:DHCP /SOMEIP/DoIP/XCP/UDPNM 传输层:TCP/IP 网络层:IPv4/IPv6/ARP/ICMP 链路层:IEEE Ethernet MAC+VLAN 物理层:Ethernet PHY: 100BASE-T1/1000BASE-T1/100BASE-Tx

专注汽车软件开发、AutoSAR、车载以太网、SOA、EE架构。 8358

Android中实现全屏、无标题栏的两种办法(另附Android系统自带样式的解释)

实现全屏无标题栏:1.在xml文件中进行配置AndroidManifest.xml中,找到需要全屏或设置成无标题栏的Activity,在该Activity进行如下配置即可。全屏效果: android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 无标题栏(但有系统状态栏): android:theme="@android:style/The

有时候选择比努力更重要,但不努力,连选择的机会都没有! 4050

RKNN 端侧部署必看:YOLOv11 Pose 姿态估计模型转换与性能优化实战

随着人工智能技术在边缘计算领域的快速发展,姿态估计作为计算机视觉的重要分支,在智能监控、人机交互、体感游戏等场景中展现出巨大的应用潜力。本文深入研究了YOLOv11 Pose模型在Rockchip RKNN平台上的部署方案,从理论基础、模型转换、平台优化到实际部署进行了全面阐述。通过详细的技术分析和实验验证,证明了RKNN平台能够有效提升YOLOv11 Pose的推理性能,在RK3588硬件平台上实现了高达100 FPS的实时姿态检测,为边缘计算场景下的姿态估计应用提供了高效的解决方案。

m0_71589036的博客 183

【Android】去除ActionBar、TitleBar、全屏

首先,在values/styles.xml中设置当前App的主题 <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light"> <!-- 去除ActionBar、TitleBar...

midnight_time的博客 586

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Android中去掉TitleBar、设置应用全屏

在Android App开发中去掉TitleBar、设置应用的全屏是很常见的操作,下面记录一下设置的几种方法: 1)方法一:在manifest文件中设置: 如下图修改:android:theme="@android:style/Theme.Light.NoTitleBar" 运行的效果图: 设置全屏只需要将android:theme="@android:st

axsz7789451的博客 2626

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

Android非常简单的使应用程序全屏显示

全屏显示

fulianwu的专栏 4263

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

Android UI 设计之TitleBar

今天上Android课老师让做一个app的界面,不过界面实在是简单,仅仅是拖几个控件来就完成任务。所以我想自己好好研究一下,界面设计到底是如何做的。下面就先从系统自带的TitleBar开始。

onClickLiKe的专栏 504

主题设置、自定义主题、取消titlebar、Activity全屏幕显示

主题设置、自定义主题、取消titlebar、Activity全屏幕显示 第一种:Activity全屏幕显示 在AndroidManifest中设置改Activity的属性为:                     android:screenOrientation="portrait"             android:theme="@android:style/The

幻化万千戏红尘 801

Android关于全屏设置和隐藏状态栏、沉浸式状态栏的总结

1.全屏和推出全屏   实现全屏  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);  有一个View.setLayoutparams的方法,注意这个LayoutParams跟的不是自身的LayoutParams而是父容器的lay...

https://github.com/Mac-Zhu 1万+

标题栏透明android,Android 中activity实现全屏无标题栏透明

1.在xml文件中进行配置在项目的清单文件AndroidManifest.xml中,在对应Activity进行如下配置即可。 2.编写代码设置在对应activity的onCreate()方法中加入如下代码即可实现全屏效果:getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutPar...

weixin_39576751的博客 408

2022-02-11 Android 沉浸式全屏、透明状态栏与状态栏文字颜色。

一、布局文件里面定义一个ImageView。 <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="

海月汐辰 1万+

android 动态设置title,Android Activity的title的设置

1、改变标题内容:public void setTitle (CharSequence title)2、隐藏标题:requestWindowFeature(Window.FEATURE_NO_TITLE);3、隐藏标题和最上面的电池电量及信号栏(全屏):public void setFullscreen() {requestWindowFeature(Window.FEATURE_NO_TITLE...

weixin_29796903的博客 1916

Android实现Splash界面全屏效果

怎样实现类似于“BOSS直招”Splash界面(Android启动界面)的那种全屏效果呢?如图所示: 其实几行代码就搞定了,以下是我实现的步骤。首先,编写界面: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/...

极客开发者的博客 8109

Android 实现透明效果的 Activity

Android系统提供了将Activity设置为透明的主题:@android:style/Theme.Translucent   该属性同时支持隐藏TitleBar和全屏显示。只需要在AndroidManifest.xml配置文件中为对应的Activity增加该属性即可。 <activity android:name=".activities.MyActivi

不停息的脚步 1850

去除titleBar

新手学习之作,本文章参考http://android.blog.51cto.com/268543/636134 本文解决activity全屏显示问题去掉屏幕上的title bar有3个方法:1. Java代码实现@Override publicvoidonCreate(BundlesavedInstanceState){ super.onCrea...

weixin_34082789的博客 157

Android全屏显示的两种方式

一 直接在AndroidManifest.xml文件中设定Activity主题为全屏模式 android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 例如:在NewGame视图中,全屏显示方法如下: &lt;activity android:name="NewGame" android:theme="@android:style...

webcenterol 133
上一篇: AE接口使用理解Geodatabase篇(一)
下一篇: SQL 查询表格中某字段不同值的最新一条记录
惜墨儿
博客等级 码龄15年 9粉丝 12原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值