溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

項目總結小問題

發(fā)布時間:2020-08-01 04:45:19 來源:網(wǎng)絡 閱讀:621 作者:Im劉亞芳 欄目:開發(fā)技術

iPhone官方SDK:如何隱藏UINavigationBar

隱藏:

[self.navigationController setNavigationBarHidden:NO animated:YES];

顯示:

[self.navigationController setNavigationBarHidden:YES animated:YES];

隱藏返回鍵
      self.navigationItem.hidesBackButton = YES;


在手勢代理方法里加以判斷

- (BOOL)gestureRecognizer:(UIGestureRecognizer*)gestureRecognizer shouldReceiveTouch:(UITouch *)touch

{

    return !([touch.view isKindOfClass:[UIControl class]]);

}

uilabel 添加點擊事件

UITapGestureRecognizer *tapGestureTel = [[[UITapGestureRecognizeralloc]initWithTarget:self action:@selector(teleButtonEvent:)]autorelease];

    [telephoneLabel addGestureRecognizer:tapGestureTel];



collectionView

/*------------類目詳細列表----------*/
    
    UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
//    flowLayout.itemSize = CGSizeMake(63, 75);  //三列的
    flowLayout.itemSize = CGSizeMake(100, 120);
    flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;  //滾動方向的設置--垂直
//    flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal; //滾動方向  --水平
    flowLayout.minimumLineSpacing = 10;
    
    self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(95, 108, 215, 426) collectionViewLayout:flowLayout];
    self.collectionView.backgroundColor = [UIColor whiteColor];
    self.collectionView.delegate = self;
    self.collectionView.dataSource = self;
//    self.collectionView.showsHorizontalScrollIndicator = NO;  //隱藏水平滾動條
    self.collectionView.showsVerticalScrollIndicator = NO;     //隱藏垂直滾動條
    [self.collectionView registerClass:[MyUICollectionViewCell class] forCellWithReuseIdentifier:@"aaa"];
    [self.view addSubview:self.collectionView];
    [flowLayout release];
    [_collectionView release];



NSNumber * time= listModel.lastUptrackAt;
    NSDate *date = [[[NSDate alloc]initWithTimeIntervalSince1970:[time doubleValue]/1000.0]autorelease]; //把毫秒的時間轉化成時間
    NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
    dateFormatter.dateFormat = @"yyyy-MM-dd";
    NSString *date2 = [dateFormatter stringFromDate:date];  //把時間進行格式化
    cell.labelTime.text = [NSString stringWithFormat:@"最后更新:%@",date2];


    

    




ios設置tableview默認選中第一行并實現(xiàn)點擊第一行的效果

    //如果有數(shù)據(jù),默認選中第一行并請求第一行的數(shù)據(jù)    
        if(self.tableViewData.count>0)    
        {    
            [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0] animated:YES scrollPosition:UITableViewScrollPositionTop];//設置選中第一行(默認有藍色背景)    
            [self tableView:self.tableView didSelectRowAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:0]];//實現(xiàn)點擊第一行所調用的方法    
        }
向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內容。

AI