原创 UINavigationBar + UISegmentedControl

//navigationBar通常只有左、右兩個按鈕,但可以 //通過添加UISegmentedControl來增加控制按鈕 UINavigationBar* _navBar; UISegmentedControl* _SegCtl;

原创 用了UINavigationController後,UITableView reloadData或viewWillAppear失效

今天在做開發的時候,忽然發現在視圖的viewWillAppear:方法中添加: [self.tableView reloadData];  不起作用,viewWillAppear:這個方法根本沒有調用 後來發現原來用了UINavig

原创 Iphone常用代碼

更改cell選中的背景   Java代碼 //創建一個UIView對象     UIView *myview = [[UIView alloc] init];    //設置UIView對象的外觀大小     myview

原创 navigation bar item button樣式

UIButton *BackBtn = [[UIButton alloc] initWithFrame:CGRectMake(0.0, 100.0, 62.0, 29.0)]; [BackBtn setImage:[UIImage i

原创 用UITableView 進行多選的代碼例子

  代碼如下:

原创 navivation 上改標題和加按鈕

NavigationBar.topItem.title = @""; NavigationBar.topItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"

原创 設置Navivation標題背景

UIImage *image = [UIImage imageNamed:@"歷史標題.png"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image];

原创 UIApplication

1, statusBar //to obtain the statusBar frame [[UIApplication sharedApplication] statusBarFrame]; //hidden status

原创 談談android下免費+廣告的盈利模式

     前段時間利用業餘時間做了2個app,採用的模式爲免費+廣告。考慮到用戶大多面向於國內,所以廣告代理選的也是國內一家廣告代理商。其實,我並不是一定就想要通過此手段去賺錢什麼的,只不過想試試水而已。想了解下android平臺下廣告收

原创 設置 UITableViewCell 與導航條間距

 UITableView 的 cell 默認出現在 uitableview 的第一行,如果你想自定義 UITableViewCell 與導航條間距的話,可以使用下面這行代碼   tableview.tableHeaderView =

原创 iPhone 開發過程中的一些小技術的總結

1 隨機數的使用        頭文件的引用        #import <time.h>        #import <mach/mach_time.h>        srandom()的使用        srandom((un

原创 給 TextView 加個圓角

 給 TextView 加上圓角無疑會讓界面更漂亮更有蘋果味兒     #import <QuartzCore/QuartzCore.h> [self.content.layer setBackgroundColor:[[

原创 iPhone上讀取ansi字符串的例子

iPhone的NSString並不支持ansi的字符串(比如咱們常用的gb2312), 因此如果要讀取的話, 需要轉換爲UTF-8的而iPhone上自帶了libiconv庫, 於是這個轉換變的就比較簡單了首先在工程的Framework部分

原创 如何爲UINavigationBar設置背景圖片

///////////////////////////////////////////////////////// /* input: The image and a tag to later identify the view */ @

原创 iPhone中如何從Application Bundle中讀取文件

首先必須將文件加入Xcode工程的Resources目錄。然後可以如下訪問文件,假設文件爲MyFile.txt: NSString *filePath = [[NSBundle mainBundle] pathForResource:@