在做我们自己的APP的时候,为了让APP看起来更加的好看,我们就需要将我们的自己的View做成圆角的,毕竟主流也是将很多东西做成圆角,和苹果的外观看起来差不多,看起来也还不错。
要将一个View做成圆角的也很容易,只需要建立一个自定义的Drawable就可以了。
我们在res/drawable下面建立一个shape的drawable,代码如下:
[ht...
分类:
移动开发 时间:
2014-11-19 01:59:04
阅读次数:
254
有时候根据具体需求,我们可能要改变窗口的形状。使用API函数SetWindowRgn可以改变一个窗体的可见范围。
使用API函数CreateRoundRectRgn()函数可以创建一个圆角矩形区域。
图片ID为:IDB_BACKBMP
BOOL CDemoDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the ...
为了实现圆角的对话框窗口,这里主要用两个函数,
CreateRoundRectRgn,和SetWindowRgn
程序先通过GetWindowRgn函数得到窗口矩形,然后通过CreateRoundRectRgn函数创建一个圆角矩形,最后通过SetWindowRgn函数改变窗口的形状。
具体操作如下:
1 打开“class view”,右击“CMyDlg”,出现一个菜单,选择“...
Jeff Lee blog: http://www.cnblogs.com/Alandre/ (泥沙砖瓦浆木匠),retain the url when reproduced ! Thanks 今天我们来Android UI第一讲:实现Layout 背景局部Shape圆角设计 效果图: 第一步:定义...
分类:
移动开发 时间:
2014-11-19 00:22:27
阅读次数:
206
在res目录下的drawable-mdpi建立xml文件shape.xml,如下图所示:shape.xml<?xmlversion="1.0"encoding="UTF-8"?><shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!--填充的颜色-->
<solidandroid:color="..
分类:
移动开发 时间:
2014-11-17 19:42:41
阅读次数:
147
Document
pre {
width:100px;
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.42857143;
color: #333;
word-break: break-all;
word-wrap: break-word;
background...
分类:
其他好文 时间:
2014-11-17 16:01:23
阅读次数:
210
摘要: 继‘带箭头提示框’,本文将分享几款带箭头提示框。qtipqTip是一种先进的提示插件,基于jQuery框架。以用户友好,而且功能丰富,qTip为您提供不一般的功能,如圆角和语音气泡提示,并且最重要的是免费。支持ie6+以及其他主流浏览器grumble.jsgrumble.js提供了特殊的提....
分类:
其他好文 时间:
2014-11-17 09:10:40
阅读次数:
270
android shape的使用
shape用于设定形状,可以在selector,layout等里面使用,有6个子标签,各属性如下:
xml version="1.0" encoding="utf-8"?>
shape xmlns:android="http://schemas.android.com/apk/res/android" >
圆角 -->
...
分类:
移动开发 时间:
2014-11-14 17:45:12
阅读次数:
155