android:shape属性详解】的更多相关文章

这一类的shape定义在xml中 file location: res/drawable/filename.xml The filename is used as the resource ID.(这个文件名作为资源id) compiled resource datatype:(复杂资源的数据类型) Resource pointer to a GradientDrawable. resource reference(资源参考): In Java: R.drawable.filename In X…
一.简单使用 刚开始,就先不讲一堆标签的意义及用法,先简单看看shape标签怎么用. 1.新建shape文件 首先在res/drawable文件夹下,新建一个文件,命名为:shape_radius.xml 内容是这样的:(先不需要理解,先看shape怎么用) <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk…
有时候 ,为了满足一些需求,我们要用到 shape 去定义 一些背景,shape 的用法 跟图片一样 ,可以给View设置 Android:background="@drawable/shape", 定义的shape 文件,放在 res/shape 目录下 通常我们可以用shape 做 button 的背景选择器,也可以做切换tab 时,底部的下划线. 先看我们用shape 都可以做什么 shape下面 一共有6个子节点, 常用的 就只有 四个,padding 和size 一般用不到.…
属性详解 标签: android 2015-06-11 17:47 27940人阅读 评论(7) 收藏 举报 分类: Android(95) 项目点滴(25) 昨天在用360扫描应用漏洞时,扫描结果,出来一个Android:exported属性,其实之前根本不知道这个属性,更不知道这个属性用来干嘛的,详情见下图: 因此,查了官方API,学习了一下这个属性! android:exported 是Android中的四大组件 Activity,Service,Provider,Receiver 四大组…
android:layout_weight是一个经常会用到的属性,它只在LinearLayout中生效,下面我们就来看一下: 当我们把组件宽度设置都为”match_parent”时: <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="3" android:text="按钮1&…
RelativeLayout用到的一些重要的属性: 第一类:属性值为true或false android:layout_centerHrizontal  水平居中 android:layout_centerVertical   垂直居中 android:layout_centerInparent    相对于父元素完全居中 android:layout_alignParentBottom 贴紧父元素的下边缘 android:layout_alignParentLeft   贴紧父元素的左边缘 a…
LinearLayout布局: 线性版面配置,在这个标签中,所有元件都是按由上到下的排队排成的.在这个界面中,我们应用了一个 LinearLayout的布局,它是垂直向下扩展的 ,所以创建的布局XML文件,以<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="…
View的布局显示方式有下面几种: 线性布局(LinearLayout) 相对布局(RelativeLayout) 表格布局(TableLayout) 网格视图(GridView) 标签布局(TabLayout) 列表视图(ListView) 绝对布局(AbsoluteLayout) 本文主要详细讲述一些参值. RelativeLayout用到的一些重要的属性: 第一类:属性值为true或false android:layout_centerHrizontal   水平居中 android:la…
weight:重量.权重. 当我们给一个view设置了android:layout_weight属性,意味着赋予它话语权,常规思维就是谁的weight大,谁说了算(空间占比大). 下面我们来看下具体的代码: <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <Button android:text="我的weigh…
Android功能强大,界面华丽,但是众多的布局属性就害苦了开发者,下面这篇文章结合了网上不少资料. 第一类:属性值为true或falseandroid:layout_centerHrizontal 水平居中 (Hrizontal表示水平)android:layout_centerVertical 垂直居中 (Vertiacl表示垂直)android:layout_centerInparent 相对于父元素完全居中android:layout_alignParentBottom 贴紧父元素的下边…