日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

山寨今日头条的标题title效果

發(fā)布時間:2023/12/18 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 山寨今日头条的标题title效果 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

山寨今日頭條的標題title效果

效果:

源碼:

// // ViewController.m // 今日頭條 // // Created by YouXianMing on 14/11/26. // Copyright (c) 2014年 YouXianMing. All rights reserved. // #import "ViewController.h"@interface ViewController ()<UIScrollViewDelegate> @property (nonatomic, strong) UIScrollView *scrollView; @property (nonatomic, strong) UIView *alphaView; @end@implementation ViewController- (void)viewDidLoad {[super viewDidLoad];[self.view addSubview:[self theSubView]];[self.view addSubview:[self theFrontView]];self.scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds];self.scrollView.delegate = self;self.scrollView.pagingEnabled = YES;self.scrollView.contentSize = CGSizeMake(self.scrollView.bounds.size.width * 2,self.scrollView.bounds.size.height);[self.view addSubview:self.scrollView]; }- (void)scrollViewDidScroll:(UIScrollView *)scrollView {CGRect rect = self.alphaView.frame;rect.origin.x = scrollView.contentOffset.x / 2.f;self.alphaView.frame = rect; }- (UIView *)theSubView {// 添加前景色UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 50, 320, 70)];backView.backgroundColor = [UIColor colorWithRed:0.922 green:0.922 blue:0.922 alpha:1];[self.view addSubview:backView];// 標題1UILabel *title1 = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 160, 70)];title1.text = @"今日頭條";title1.textAlignment = NSTextAlignmentCenter;title1.font = [UIFont systemFontOfSize:20.f];title1.textColor = [UIColor colorWithRed:0.443 green:0.439 blue:0.439 alpha:1];[backView addSubview:title1];// 標題2UILabel *title2 = [[UILabel alloc] initWithFrame:CGRectMake(160, 0, 160, 70)];title2.text = @"YouXianMing";title2.textAlignment = NSTextAlignmentCenter;title2.font = [UIFont systemFontOfSize:20.f];title2.textColor = [UIColor colorWithRed:0.443 green:0.439 blue:0.439 alpha:1];[backView addSubview:title2];return backView; }- (UIView *)theFrontView {// 添加前景色UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 50, 320, 70)];backView.backgroundColor = [UIColor colorWithRed:0.808 green:0.208 blue:0.212 alpha:1];[self.view addSubview:backView];// 標題1UILabel *title1 = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 160, 70)];title1.text = @"今日頭條";title1.textAlignment = NSTextAlignmentCenter;title1.font = [UIFont systemFontOfSize:20.f];title1.textColor = [UIColor colorWithRed:0.945 green:0.827 blue:0.827 alpha:1];[backView addSubview:title1];// 標題2UILabel *title2 = [[UILabel alloc] initWithFrame:CGRectMake(160, 0, 160, 70)];title2.text = @"YouXianMing";title2.textAlignment = NSTextAlignmentCenter;title2.font = [UIFont systemFontOfSize:20.f];title2.textColor = [UIColor colorWithRed:0.945 green:0.827 blue:0.827 alpha:1];[backView addSubview:title2];self.alphaView = [[UIView alloc] initWithFrame:CGRectMake(0, 10, 160, 50)];self.alphaView.backgroundColor = [UIColor blackColor];self.alphaView.layer.cornerRadius = 15.f;backView.maskView = self.alphaView;return backView; }@end

圖片:

一切盡在不言中:)

?

轉(zhuǎn)載于:https://www.cnblogs.com/YouXianMing/p/4125132.html

總結(jié)

以上是生活随笔為你收集整理的山寨今日头条的标题title效果的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。