0
我目前正在開發iPhone應用程序,其中有一個ImageView展示一些圖像並通過刷卡可以更改圖像。iOS添加頂部欄作爲子視圖
但我目前正在嘗試添加一個子視圖,它將成爲頂級欄,當圖片被觸摸時,它會使頂部欄從頂部向下滑動。
當前的代碼我試着做到這一點的是:
CGRect frame = CGRectMake(0.0f, 0.0f, self.view.frame.size.width, 60.0f);
UIView *topBar = [[UIView alloc] initWithFrame:frame];
[self.view addSubview:topBar];
[self.view bringSubviewToFront:topBar];
但頂欄會顯示不出來,我有記錄顯示,觸摸被認可。
我該如何做,以及如何正確填充按鈕的子視圖?
最好的問候。
FreeSirenety