当前位置: 编程技术>移动开发
本页文章导读:
▪ScrollView嵌套GridView的解决方法 ScrollView嵌套GridView的解决办法
前些日子在开发中用到了需要ScrollView嵌套GridView的情况,由于这两款控件都自带滚动条,当他们碰到一起的时候便会出问题,即GridView会显示不全。 解决办法.........
▪ 怎的在Xcode4中用Git对已有项目进行版本管理 怎样在Xcode4中用Git对已有项目进行版本管理
你可能已经知道了,Xcode4 带来了一大堆让给苹果的开发者们兴奋的改进。
现在你可以给你的项目设置多个仓库(repositories),当然现在最流行,好.........
▪ 色彩大全 颜色大全
颜色大全:颜色名称和颜色值。色板、色板对照表。aliceblue:艾利斯兰 ColorValue = "#F0F8FF";antiquewhite:古董白 ColorValue = "#FAEBD7";aqua:浅绿色 ColorValue = "#00FFFF";aquama.........
[1]ScrollView嵌套GridView的解决方法
来源: 互联网 发布时间: 2014-02-18
ScrollView嵌套GridView的解决办法
前些日子在开发中用到了需要ScrollView嵌套GridView的情况,由于这两款控件都自带滚动条,当他们碰到一起的时候便会出问题,即GridView会显示不全。
解决办法,自定义一个GridView控件
public class MyGridView extends GridView {
public MyGridView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyGridView(Context context) {
super(context);
}
public MyGridView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(
Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}
该自定义控件只是重写了GridView的onMeasure方法,使其不会出现滚动条,ScrollView嵌套ListView也是同样的道理,不再赘述。
XML布局代码
<ScrollView Android:layout_height="wrap_content"
Android:layout_width="fill_parent" android:id="@+id/scroll_content">
<com.yourclass.MyGridView xmlns:Android="http://schemas.android.com/apk/res/android"
Android:id="@+id/grid_view" android:layout_width="fill_parent"
Android:layout_height="wrap_content" android:numColumns="auto_fit"
Android:horizontalSpacing="1dip" android:verticalSpacing="1dip"
Android:columnWidth="150dip" android:stretchMode="columnWidth"
Android:gravity="center">
</com.yourclass.MyGridView>
</ScrollView>
Java调用代码
MyGridView gridview = (MyGridView) findViewById(R.id.grid_view);
gridview.setAdapter(new ImageAdapter(this));
前些日子在开发中用到了需要ScrollView嵌套GridView的情况,由于这两款控件都自带滚动条,当他们碰到一起的时候便会出问题,即GridView会显示不全。
解决办法,自定义一个GridView控件
public class MyGridView extends GridView {
public MyGridView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyGridView(Context context) {
super(context);
}
public MyGridView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(
Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}
该自定义控件只是重写了GridView的onMeasure方法,使其不会出现滚动条,ScrollView嵌套ListView也是同样的道理,不再赘述。
XML布局代码
<ScrollView Android:layout_height="wrap_content"
Android:layout_width="fill_parent" android:id="@+id/scroll_content">
<com.yourclass.MyGridView xmlns:Android="http://schemas.android.com/apk/res/android"
Android:id="@+id/grid_view" android:layout_width="fill_parent"
Android:layout_height="wrap_content" android:numColumns="auto_fit"
Android:horizontalSpacing="1dip" android:verticalSpacing="1dip"
Android:columnWidth="150dip" android:stretchMode="columnWidth"
Android:gravity="center">
</com.yourclass.MyGridView>
</ScrollView>
Java调用代码
MyGridView gridview = (MyGridView) findViewById(R.id.grid_view);
gridview.setAdapter(new ImageAdapter(this));
[2] 怎的在Xcode4中用Git对已有项目进行版本管理
来源: 互联网 发布时间: 2014-02-18
怎样在Xcode4中用Git对已有项目进行版本管理
你可能已经知道了,Xcode4 带来了一大堆让给苹果的开发者们兴奋的改进。
现在你可以给你的项目设置多个仓库(repositories),当然现在最流行,好用的就是用Git来进行版本控制了。
当然如果用 Xcode4 创建一个新的项目,并使用Git版本管理非常方便,只要在新建项目时把Source Control这个复选框勾上就可以了。
但对已有的项目,怎样用Git来管理呢?其实也不难,首先用Terminal 到你项目的路径,然后用Git命令进行初始化,比如说
cd /workspace/WorkXP git init git add . git commit -m 'Initial commit'
然后把Xcode重启之后,就会发现项目已经自动检测到用Git管理了
http://yuanping.workxp.info/2011/09/16/how-to-create-git-repos-for-exitsting-xcode-projects/
[3] 色彩大全
来源: 互联网 发布时间: 2014-02-18
颜色大全
颜色大全:颜色名称和颜色值。色板、色板对照表。
aliceblue:艾利斯兰 ColorValue = "#F0F8FF";
antiquewhite:古董白 ColorValue = "#FAEBD7";
aqua:浅绿色 ColorValue = "#00FFFF";
aquamarine:碧绿色 ColorValue = "#7FFFD4";
azure:天蓝色 ColorValue = "#F0FFFF";
beige:米色 ColorValue = "#F5F5DC";
bisque:桔黄色 ColorValue = "#FFE4C4";
black:黑色 ColorValue = "#000000";
blanchedalmond:白杏色 ColorValue = "#FFEBCD";
blue:蓝色 ColorValue = "#0000FF";
blueviolet:紫罗兰色 ColorValue = "#8A2BE2";
brown:褐色 ColorValue = "#A52A2A";
burlywood:实木色 ColorValue = "#DEB887";
cadetblue:军兰色 ColorValue = "#5F9EA0";
chartreuse:黄绿色 ColorValue = "#7FFF00";
chocolate:巧可力色 ColorValue = "#D2691E";
coral:珊瑚色 ColorValue = "#FF7F50";
cornflowerblue:菊兰色 ColorValue = "#6495ED";
cornsilk:米绸色 ColorValue = "#FFF8DC";
crimson:暗深红色 ColorValue = "#DC143C";
cyan:青色 ColorValue = "#00FFFF";
darkblue:暗蓝色 ColorValue = "#00008B";
darkcyan:暗青色 ColorValue = "#008B8B";
darkgoldenrod:暗金黄色 ColorValue = "#B8860B";
darkgray:暗灰色 ColorValue = "#A9A9A9";
darkgreen:暗绿色 ColorValue = "#006400";
darkkhaki:暗黄褐色 ColorValue = "#BDB76B";
darkmagenta:暗洋红 ColorValue = "#8B008B";
darkolivegreen:暗橄榄绿 ColorValue = "#556B2F";
darkorange:暗桔黄色 ColorValue = "#FF8C00";
darkorchid:暗紫色 ColorValue = "#9932CC";
darkred:暗红色 ColorValue = "#8B0000";
darksalmon:暗肉色 ColorValue = "#E9967A";
darkseagreen:暗海兰色 ColorValue = "#8FBC8F";
darkslateblue:暗灰蓝色 ColorValue = "#483D8B";
darkslategray:墨绿色 ColorValue = "#2F4F4F";
darkturquoise:暗宝石绿 ColorValue = "#00CED1";
darkviolet:暗紫罗兰色 ColorValue = "#9400D3";
deeppink:深粉红色 ColorValue = "#FF1493";
deepskyblue:深天蓝色 ColorValue = "#00BFFF";
dimgray:暗灰色 ColorValue = "#696969";
dodgerblue:闪兰色 ColorValue = "#1E90FF";
firebrick:火砖色 ColorValue = "#B22222";
floralwhite:花白色 ColorValue = "#FFFAF0";
forestgreen:森林绿 ColorValue = "#228B22";
fuchsia:紫红色 ColorValue = "#FF00FF";
gainsboro:淡灰色 ColorValue = "#DCDCDC";
ghostwhite:幽灵白 ColorValue = "#F8F8FF";
gold:金色 ColorValue = "#FFD700";
goldenrod:金麒麟色 ColorValue = "#DAA520";
gray:灰色 ColorValue = "#808080";
green:绿色 ColorValue = "#008000";
greenyellow:黄绿色 ColorValue = "#ADFF2F";
honeydew:蜜色 ColorValue = "#F0FFF0";
hotpink:热粉红色 ColorValue = "#FF69B4";
indianred:印第安红 ColorValue = "#CD5C5C";
indigo:靛青色 ColorValue = "#4B0082";
ivory:象牙色 ColorValue = "#FFFFF0";
khaki:黄褐色 ColorValue = "#F0E68C";
lavender:淡紫色 ColorValue = "#E6E6FA";
lavenderblush:淡紫红 ColorValue = "#FFF0F5";
lawngreen:草绿色 ColorValue = "#7CFC00";
lemonchiffon:柠檬绸色 ColorValue = "#FFFACD";
lightblue:亮蓝色 ColorValue = "#ADD8E6";
lightcoral:亮珊瑚色 ColorValue = "#F08080";
lightcyan:亮青色 ColorValue = "#E0FFFF";
lightgoldenrodyellow:亮金黄色 ColorValue = "#FAFAD2";
lightgreen:亮绿色 ColorValue = "#90EE90";
lightgrey:亮灰色 ColorValue = "#D3D3D3";
lightpink:亮粉红色 ColorValue = "#FFB6C1";
lightsalmon:亮肉色 ColorValue = "#FFA07A";
lightseagreen:亮海蓝色 ColorValue = "#20B2AA";
lightskyblue:亮天蓝色 ColorValue = "#87CEFA";
lightslategray:亮蓝灰 ColorValue = "#778899";
lightsteelblue:亮钢兰色 ColorValue = "#B0C4DE";
lightyellow:亮黄色 ColorValue = "#FFFFE0";
颜色大全:颜色名称和颜色值。色板、色板对照表。
aliceblue:艾利斯兰 ColorValue = "#F0F8FF";
antiquewhite:古董白 ColorValue = "#FAEBD7";
aqua:浅绿色 ColorValue = "#00FFFF";
aquamarine:碧绿色 ColorValue = "#7FFFD4";
azure:天蓝色 ColorValue = "#F0FFFF";
beige:米色 ColorValue = "#F5F5DC";
bisque:桔黄色 ColorValue = "#FFE4C4";
black:黑色 ColorValue = "#000000";
blanchedalmond:白杏色 ColorValue = "#FFEBCD";
blue:蓝色 ColorValue = "#0000FF";
blueviolet:紫罗兰色 ColorValue = "#8A2BE2";
brown:褐色 ColorValue = "#A52A2A";
burlywood:实木色 ColorValue = "#DEB887";
cadetblue:军兰色 ColorValue = "#5F9EA0";
chartreuse:黄绿色 ColorValue = "#7FFF00";
chocolate:巧可力色 ColorValue = "#D2691E";
coral:珊瑚色 ColorValue = "#FF7F50";
cornflowerblue:菊兰色 ColorValue = "#6495ED";
cornsilk:米绸色 ColorValue = "#FFF8DC";
crimson:暗深红色 ColorValue = "#DC143C";
cyan:青色 ColorValue = "#00FFFF";
darkblue:暗蓝色 ColorValue = "#00008B";
darkcyan:暗青色 ColorValue = "#008B8B";
darkgoldenrod:暗金黄色 ColorValue = "#B8860B";
darkgray:暗灰色 ColorValue = "#A9A9A9";
darkgreen:暗绿色 ColorValue = "#006400";
darkkhaki:暗黄褐色 ColorValue = "#BDB76B";
darkmagenta:暗洋红 ColorValue = "#8B008B";
darkolivegreen:暗橄榄绿 ColorValue = "#556B2F";
darkorange:暗桔黄色 ColorValue = "#FF8C00";
darkorchid:暗紫色 ColorValue = "#9932CC";
darkred:暗红色 ColorValue = "#8B0000";
darksalmon:暗肉色 ColorValue = "#E9967A";
darkseagreen:暗海兰色 ColorValue = "#8FBC8F";
darkslateblue:暗灰蓝色 ColorValue = "#483D8B";
darkslategray:墨绿色 ColorValue = "#2F4F4F";
darkturquoise:暗宝石绿 ColorValue = "#00CED1";
darkviolet:暗紫罗兰色 ColorValue = "#9400D3";
deeppink:深粉红色 ColorValue = "#FF1493";
deepskyblue:深天蓝色 ColorValue = "#00BFFF";
dimgray:暗灰色 ColorValue = "#696969";
dodgerblue:闪兰色 ColorValue = "#1E90FF";
firebrick:火砖色 ColorValue = "#B22222";
floralwhite:花白色 ColorValue = "#FFFAF0";
forestgreen:森林绿 ColorValue = "#228B22";
fuchsia:紫红色 ColorValue = "#FF00FF";
gainsboro:淡灰色 ColorValue = "#DCDCDC";
ghostwhite:幽灵白 ColorValue = "#F8F8FF";
gold:金色 ColorValue = "#FFD700";
goldenrod:金麒麟色 ColorValue = "#DAA520";
gray:灰色 ColorValue = "#808080";
green:绿色 ColorValue = "#008000";
greenyellow:黄绿色 ColorValue = "#ADFF2F";
honeydew:蜜色 ColorValue = "#F0FFF0";
hotpink:热粉红色 ColorValue = "#FF69B4";
indianred:印第安红 ColorValue = "#CD5C5C";
indigo:靛青色 ColorValue = "#4B0082";
ivory:象牙色 ColorValue = "#FFFFF0";
khaki:黄褐色 ColorValue = "#F0E68C";
lavender:淡紫色 ColorValue = "#E6E6FA";
lavenderblush:淡紫红 ColorValue = "#FFF0F5";
lawngreen:草绿色 ColorValue = "#7CFC00";
lemonchiffon:柠檬绸色 ColorValue = "#FFFACD";
lightblue:亮蓝色 ColorValue = "#ADD8E6";
lightcoral:亮珊瑚色 ColorValue = "#F08080";
lightcyan:亮青色 ColorValue = "#E0FFFF";
lightgoldenrodyellow:亮金黄色 ColorValue = "#FAFAD2";
lightgreen:亮绿色 ColorValue = "#90EE90";
lightgrey:亮灰色 ColorValue = "#D3D3D3";
lightpink:亮粉红色 ColorValue = "#FFB6C1";
lightsalmon:亮肉色 ColorValue = "#FFA07A";
lightseagreen:亮海蓝色 ColorValue = "#20B2AA";
lightskyblue:亮天蓝色 ColorValue = "#87CEFA";
lightslategray:亮蓝灰 ColorValue = "#778899";
lightsteelblue:亮钢兰色 ColorValue = "#B0C4DE";
lightyellow:亮黄色 ColorValue = "#FFFFE0";
最新技术文章: