當沒有數據時,設置一張背景圖片提示無數據


#import "UIView+AutoLayout.h"

@property (nonatomic, weak) UIImageView *noDataView;


- (UIImageView *)noDataView
{
    if (!_noDataView) {
        // 添加一個"沒有數據"的提醒
        UIImageView *noDataView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_deals_empty"]];
        [self.view addSubview:noDataView];
        [noDataView autoCenterInSuperview];
        self.noDataView = noDataView;
    }
    return _noDataView;
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM