自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

ios高仿暴風視頻播放器app源碼

移動開發(fā)
這是一款仿照暴風影音做的demo,因為項目需要,所以順便把他完善一點,功能有側(cè)滑,滾動導(dǎo)航欄,tableView ,collectionView的高度定制,希望能幫助到有需求的碼友。

源碼簡介:這是一款仿照暴風影音做的demo,因為項目需要,所以順便把他完善一點,功能有側(cè)滑,滾動導(dǎo)航欄,tableView ,collectionView的高度定制,希望能幫助到有需求的碼友。

源碼效果:

源碼片段:

  1. - (void)viewDidLoad 
  2.     self.view.backgroundColor = [UIColor whiteColor]; 
  3.     UIView *statusBarView = [[UIImageView alloc] initWithFrame:CGRectMake(0.f, 0.f, self.view.frame.size.width, 0.f)]; 
  4.     if (isIos7 >= 7 && __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_6_1) 
  5.     { 
  6.         statusBarView.frame = CGRectMake(statusBarView.frame.origin.x, statusBarView.frame.origin.y, statusBarView.frame.size.width, 20.f); 
  7.         statusBarView.backgroundColor = [UIColor clearColor]; 
  8.         ((UIImageView *)statusBarView).backgroundColor = RGBA(33.f,125.f,194.f,1); 
  9.         [self.view addSubview:statusBarView]; 
  10.     } 
  11.       
  12.     //導(dǎo)航欄 
  13.     _navView = [[UIImageView alloc] initWithFrame:CGRectMake(0.f, StatusbarSize, self.view.frame.size.width, 50.f)]; 
  14.     ((UIImageView *)_navView).backgroundColor = RGBA(33.f,125.f,194.f,1); 
  15.     [self.view insertSubview:_navView belowSubview:statusBarView]; 
  16.     _navView.userInteractionEnabled = YES; 
  17.       
  18.     //導(dǎo)航欄圖標 
  19.     [self setNavbtn]; 
  20.       
  21.     //滾動導(dǎo)航欄 
  22.     _topNaviV = [[UIView alloc] initWithFrame:CGRectMake(0, _navView.frame.size.height + _navView.frame.origin.y, self.view.frame.size.width, MENU_HEIGHT)]; 
  23.     _topNaviV.backgroundColor = RGBA(33.f,125.f,194.f,1); 
  24.     [self.view addSubview:_topNaviV]; 
  25.       
  26.     //滾動頁面 
  27.     _scrollV = [[UIScrollView alloc] initWithFrame:CGRectMake(0, _topNaviV.frame.origin.y + _topNaviV.frame.size.height, self.view.frame.size.width, self.view.frame.size.height - _topNaviV.frame.origin.y - _topNaviV.frame.size.height)]; 
  28.     _scrollV.tag = _scrollVTag; 
  29.     [_scrollV setPagingEnabled:YES]; 
  30.     [_scrollV setShowsHorizontalScrollIndicator:NO]; 
  31.     [self.view insertSubview:_scrollV belowSubview:_navView]; 
  32.     _scrollV.delegate = self; 
  33.     [_scrollV.panGestureRecognizer addTarget:self action:@selector(scrollHandlePan:)]; 
  34.       
  35.     //選擇彈出的view 
  36.     _selectTabV = [[UIView alloc] initWithFrame:CGRectMake(0, _scrollV.frame.origin.y - _scrollV.frame.size.height, _scrollV.frame.size.width, _scrollV.frame.size.height)]; 
  37.     [_selectTabV setBackgroundColor:RGBA(255.f, 209.f, 56.f, 1)]; 
  38.     [_selectTabV setHidden:YES]; 
  39.     [self.view insertSubview:_selectTabV belowSubview:_navView]; 
  40.       
  41.     //創(chuàng)建滾動條菜單 
  42.     [self createScrollBtns]; 
  43.       
  44.   
  45. //創(chuàng)建主導(dǎo)航菜單 
  46. -(void)setNavbtn{ 
  47.   
  48.     UIButton *MenuBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 
  49.     [MenuBtn setFrame:CGRectMake(15, 8, 20, 20)]; 
  50.     [MenuBtn setBackgroundImage:[UIImage imageNamed:@"icon_list"] forState:UIControlStateNormal]; 
  51.     [MenuBtn addTarget:self action:@selector(leftAction:) forControlEvents:UIControlEventTouchUpInside]; 
  52.     MenuBtn.showsTouchWhenHighlighted = YES; 
  53.     [_navView addSubview:MenuBtn]; 
  54.       
  55.     for (int i = 0; i < 4; i++) { 
  56.         UIButton *NavBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 
  57.         [NavBtn setFrame:CGRectMake(170 + i*40, 8 , 20, 20)]; 
  58.         NSString *NavBtn_backimg = [NSString stringWithFormat:@"slide_menu_%d@2x",i+1]; 
  59.         [NavBtn setBackgroundImage:[UIImage imageNamed:NavBtn_backimg] forState:UIControlStateNormal]; 
  60.         [NavBtn addTarget:self action:@selector(NavbtnAction:) forControlEvents:UIControlEventTouchUpInside]; 
  61.         NavBtn.tag = MENU_NAVBUTTON_TAG + i; 
  62.         [_navView addSubview:NavBtn]; 
  63.     } 
  64.   
  65. //創(chuàng)建scroll 滾動菜單 
  66. - (void)createScrollBtns 
  67.     float btnW = 40; 
  68.     UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; 
  69.     [btn setFrame:CGRectMake(_topNaviV.frame.size.width - btnW, 0, btnW, 30)]; 
  70.     [btn setBackgroundImage:[UIImage imageNamed:@"nav_more"] forState:UIControlStateNormal]; 
  71.     [_topNaviV addSubview:btn]; 
  72.     [btn addTarget:self action:@selector(showSelectView:) forControlEvents:UIControlEventTouchUpInside]; 
  73.           
  74.     _scrollDataSource = [NSMutableArray arrayWithObjects:@"推薦", @"電影", @"電視劇", @"卡通", @"綜藝", @"體育", @"娛樂", @"新聞", nil]; 
  75.       
  76.     _navScrollV = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width - btnW, MENU_HEIGHT)]; 
  77.     _navScrollV.tag = _navScrollVTag; 
  78.     [_navScrollV setShowsHorizontalScrollIndicator:NO]; 
  79.     for (int i = 0; i < [_scrollDataSource count]; i++) 
  80.     { 
  81.         UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; 
  82.         [btn setFrame:CGRectMake(MENU_BUTTON_WIDTH * i, -5, MENU_BUTTON_WIDTH, MENU_HEIGHT)]; 
  83.         [btn setTitle:[_scrollDataSource objectAtIndex:i] forState:UIControlStateNormal]; 
  84.         [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 
  85.         btn.tag = i + 1; 
  86.         [btn addTarget:self action:@selector(ScrolBtnActionbtn:) forControlEvents:UIControlEventTouchUpInside]; 
  87.         btn.showsTouchWhenHighlighted = YES; 
  88.         [_navScrollV addSubview:btn]; 
  89.     } 
  90.     [_navScrollV setContentSize:CGSizeMake(MENU_BUTTON_WIDTH * [_scrollDataSource count], MENU_HEIGHT)]; 
  91.     [_topNaviV addSubview:_navScrollV]; 
  92.       
  93.     //滾動欄底部 滾動條 
  94.     _navBgV = [[UIView alloc] initWithFrame:CGRectMake(0, MENU_HEIGHT - 5, MENU_BUTTON_WIDTH, 5)]; 
  95.     [_navBgV setBackgroundColor:[UIColor redColor]]; 
  96.     [_navScrollV addSubview:_navBgV]; 
  97.     [self addView2Page:_scrollV count:[_scrollDataSource count] frame:CGRectZero]; 
  98.   
  99. //初始化視圖內(nèi)容  顯示當前選中scroll的btn要顯示的內(nèi)容 
  100. - (void)addView2Page:(UIScrollView *)scrollV count:(NSUInteger)pageCount frame:(CGRect)frame 
  101.     for (int i = 0; i < pageCount; i++) 
  102.     { 
  103.         UIView *view = [[UIView alloc] initWithFrame:CGRectMake(scrollV.frame.size.width * i, 0, scrollV.frame.size.width, scrollV.frame.size.height)]; 
  104.         view.tag = i + 1; 
  105.           
  106.         //初始化collectionViews 視頻視圖 
  107.         [self creatScrollSubViewsInViews:view]; 
  108.           
  109.         [scrollV addSubview:view]; 
  110.     } 
  111.     [scrollV setContentSize:CGSizeMake(scrollV.frame.size.width * pageCount, scrollV.frame.size.height)]; 

下載地址:http://down.51cto.com/data/2089516

責任編輯:倪明 來源: devstore
相關(guān)推薦

2023-03-28 09:38:34

開發(fā)應(yīng)用鴻蒙

2023-03-28 09:44:02

開發(fā)應(yīng)用鴻蒙

2023-03-29 09:37:49

視頻播放器應(yīng)用鴻蒙

2015-01-22 15:44:55

Android源碼音樂播放器

2023-03-29 09:32:15

視頻播放器應(yīng)用鴻蒙

2022-06-21 14:41:38

播放器適配西瓜視頻

2009-06-01 14:05:14

2022-08-16 17:37:06

視頻播放器鴻蒙

2011-07-20 16:21:20

iPhone 視頻 播放器

2015-05-21 15:25:42

VLC播放器

2014-12-31 16:52:53

音樂播放器源碼

2021-10-19 14:27:07

鴻蒙HarmonyOS應(yīng)用

2021-10-21 16:00:07

鴻蒙HarmonyOS應(yīng)用

2022-11-12 08:26:04

VLC視頻播放器裁剪視頻

2023-03-06 16:20:08

視頻播放器VLC

2011-06-13 09:33:04

2018-05-25 14:37:58

2023-08-26 19:07:40

VLC旋轉(zhuǎn)視頻

2011-05-09 15:17:24

亞馬遜iOS蘋果

2012-06-04 13:44:08

點贊
收藏

51CTO技術(shù)棧公眾號