- 博客(5)
- 资源 (3)
- 收藏
- 关注
原创 ios设置导航条背景图片
在ios5中,可以很简单的通过UINavigationBar setBackgroundImage:myImage forBarMetrics进行设置,在ios4中,并没有现成的api使用,之前查找相关资料,基本都是要创建UINavigationBar的category,无论哪种方式都有缺陷,先介绍一种最简单完美的方式[nBar.layer setContents: (id)[
2012-10-10 17:39:44
1103
原创 Gallery自动循环滚动以及手动滚动的平滑切换
@Gallery配合dot使用时,如果放在RelativeLayout中,则手动滑动有反弹现象,其他layout没问题,现在还没弄清原因。首先继承Gallery重写OnFling函数,去除gallery的滚动惯性public class MyGallery extends Gallery { public MyGallery(Context context, AttributeSet
2012-06-05 17:43:28
4249
原创 二分查找法
template int BinarySearch(const vector & v, const tmp & a){ int nLow = 0; int nHigh = v.size() - 1; while (nLow { int mid = (nLow + nHigh) / 2; if (v[mid] { nLow = mid + 1;
2010-09-09 08:56:00
453
原创 求最大公因数--欧几里得算法
long MaxCommonFactor(long m,long n){ while(n!=0) { long rem = m%n; m=n; n=rem; } return m;}
2010-09-07 13:53:00
594
原创 求最大子序列和
void MaxSub(int *aArray,int nLen){ int max=0,current=0; for(int i=0;i { current+=aArray[i]; if(current>max) max=current; else if (curre
2010-09-07 13:43:00
376
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人