Android自定义样式
1、AndroidManifest.xml
android:theme="@style/Theme.CustomDialog
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fish.helloworld"
android:versionCode="1"
android:versionName="1.0" > <uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" /> <application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.CustomDialog" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_receive" >
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application> </manifest>
2、styles.xml
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<style name="Theme.CustomDialog" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@drawable/filled_box</item>
</style>
</resources>
3、filled_box.xml
一定放在drawable文件夹下,否在不识别
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffff8080" />
<stroke android:width="3dp" color="#ffff8080" />
<corners android:radius="3dp" />
<padding android:left="10dp" android:top="10dp"
android:right="10dp" android:bottom="10dp" />
</shape>
Android自定义样式的更多相关文章
- android自定义样式大全:shape,selector,layer-list,style,动画全部内容
原文:http://keeganlee.me/post/android/20150830 以下摘取了部分内容: shape 一般用shape定义的xml文件存放在drawable目录下,若项目没有该目 ...
- 024 Android 自定义样式对话框(AlertDialog)
1.AlertDialog介绍 AlertDialog并不需要到布局文件中创建,而是在代码中通过构造器(AlertDialog.Builder)来构造标题.图标和按钮等内容的. 常规使用步骤(具体参见 ...
- [android] 安卓自定义样式和主题
简单练习自定义样式和主题,样式是加在View上,主题是加在Application或者Activity上 styles.xml <?xml version="1.0" enco ...
- Android RatingBar 自定义样式
Android RatingBar 自定义样式 1.先定义Style: <style name="RadingStyle" parent="@android:sty ...
- android自定义弹出框样式实现
前言: 做项目时,感觉Android自带的弹出框样式比较丑,很多应用都是自己做的弹出框,这里也试着自己做了一个. 废话不说先上图片: 实现机制 1.先自定义一个弹出框的样式 2.自己实现CustomD ...
- Android 自定义RadioButton的样式
Android 自定义RadioButton的样式 我们知道Android控件里的button,listview可以用xml的样式自定义成自己希望的漂亮样式. 最近用到RadioButton,利用xm ...
- Android 自定义Button按钮显示样式(正常、按下、获取焦点)
现在的用户对APP的外观看得很重要,如果APP内所有元件都用Android默认样式写,估计下面评论里就有一堆在骂UI丑的.今天学习自定义Button按钮样式.Button样式修改的是Button的背景 ...
- xamarin android checkbox自定义样式
xamarin android checkbox自定义样式 在drawable文件在新建checkbox_bg.xml文件 <?xml version="1.0" encod ...
- Android开发:UI相关(一)自定义样式资源
一.自定义样式资源: 1.在drawble中新建xml资源文件: 如果新建的xml文件没有自动放置在drawable文件夹下,就手动移动到drawable下. 2.编写样式代码: < ...
随机推荐
- java版的YUI3 combine服务-Combo Handler
YUI3中,为了避免js文件过大,各个功能模块是拆分的.它有一个“种子”的概念:先下载一个小的核心的js文件到浏览器端,再通过这个小的js文件去加载其它所需的模块. 这种按需加载虽然解决了单个js过大 ...
- Spring中IoC的入门实例
Spring中IoC的入门实例 Spring的模块化是很强的,各个功能模块都是独立的,我们可以选择的使用.这一章先从Spring的IoC开始.所谓IoC就是一个用XML来定义生成对象的模式,我们看看如 ...
- openGL学习:Visual Studio配置OpenGL
Visual Studio配置OpenGL 分两步: (一)下载glut,并将其放置到适当的位置 (二) 进行vs2005项目属性配置 ******************************** ...
- NoSQL与关系型数据库比较
虽然09年出现了比较激进的文章<关系数据库已死>,但是我们心里都清楚,关系数据库其实还活得好好的,你还不能不用关系数据库.但是也说明了一个事实,关系数据库在处理WEB2.0数据的时候,的确 ...
- CentOS安装apache2(转载)
From:http://www.onepx.com/centos-apache-246.html 之前服务器 Apache 版本一直是 2.2.x,鉴于 Centos 更新软件的惰性,我看直到 201 ...
- Porlet标准:JSR168/JSR286/WSRP(转载)
From:http://www.iteye.com/topic/620213 Portlet标准主要是JSR168,JSR286和WSRP. JSR168因为比较早,所以大部分的Portal都支持这个 ...
- bootstrap-响应式图片、辅助类样式
响应式图片: <div class="container"> <!-- img-responsive 响应式图片 --> <div class=&qu ...
- log4Net使用 z
http://logging.apache.org/log4net/1.Log4net主要结构分析 1.1 Logger:是应用程序与Log4net进行交互的主要模块,它也是log4net生成log ...
- wait(0)
public final synchronized void join(long millis) throws InterruptedException { long base = System.cu ...
- HDU 4081 Qin Shi Huang's National Road System [次小生成树]
题意: 秦始皇要建路,一共有n个城市,建n-1条路连接. 给了n个城市的坐标和每个城市的人数. 然后建n-2条正常路和n-1条魔法路,最后求A/B的最大值. A代表所建的魔法路的连接的城市的市民的人数 ...