IOS - 关于我们页面
来源:互联网 发布:矩阵乘法结合律 编辑:程序博客网 时间:2024/05/21 00:52
关于我们(静态显示信息)
代码
//// CYAboutUsViewController.h// SymptomChecker//// Created by wcl on 15/7/2.////#import "CYWebFromLocalViewController.h"@interface CYAboutUsViewController : CYModelViewController@property (nonatomic, strong) UIWebView* webView;@end
//// CYAboutUsViewController.m// SymptomChecker//// Created by wcl on 15/7/2.////#import "CYAboutUsViewController.h"#define kViewRadio viewWidth()/320@interface CYAboutUsViewController () <UIWebViewDelegate>@end@implementation CYAboutUsViewController { NSString* _localName;}- (id) initWithQuery:(NSDictionary *)query{ self = [super initWithQuery:query]; if (self){ self.title = query[@"title"]; _localName = query[@"local_name"]; } return self;}- (void)viewDidLoad { [super viewDidLoad];}- (void) viewWillAppear:(BOOL)animated { [super viewWillAppear: animated]; [self.view setBackgroundColor:[UIColor whiteColor]]; CGRect logoRect = CGRectMake(12*kViewRadio, 20*kViewRadio, viewWidth()-24*kViewRadio, 100*kViewRadio); // Logo UIImageView *logoView = [[UIImageView alloc] initWithFrame:logoRect]; logoView.image = [UIImage imageNamed:@"mat_logo_login.png"]; logoView.contentMode = UIViewContentModeScaleAspectFit; [self.view addSubview:logoView]; CGRect versionRect = CGRectMake(12*kViewRadio, logoView.bottom+8*kViewRadio, viewWidth()-24*kViewRadio, 16*kViewRadio); // 版本 UILabel *versionView = [[UILabel alloc] initWithFrame:versionRect]; versionView.text = @"V1.0.0"; versionView.textAlignment = UITextAlignmentCenter; versionView.font = [UIFont systemFontOfSize:12*kViewRadio]; [self.view addSubview:versionView]; CGRect lineRect = CGRectMake(0, versionView.bottom+16*kViewRadio, viewWidth(), 0.5*kViewRadio); // 直线 UIView *horizontalLine = [[UIView alloc]initWithFrame:lineRect]; horizontalLine.backgroundColor = [UIColor blackColor]; [self.view addSubview:horizontalLine]; CGRect textRect = CGRectMake(0, horizontalLine.bottom+20*kViewRadio, viewWidth(), 240*kViewRadio); // 本地文本 _webView = [[UIWebView alloc] initWithFrame:textRect]; [_webView setBackgroundColor:[UIColor clearColor]]; _webView.delegate = self; [self.view addSubview: _webView]; NSString *filePath = [[NSBundle mainBundle]pathForResource:_localName ofType:@"html"]; NSString *htmlString = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil]; [_webView loadHTMLString:htmlString baseURL:nil]; CGRect endRect = CGRectMake(0, self.view.bottom-220*kViewRadio, viewWidth(), 220*kViewRadio); // 结尾 UILabel *end = [[UILabel alloc] initWithFrame:endRect]; [end setText:@"TEL: 400-110-0866\n(按当地市话标准收费)\nxxx有限公司\nxxx.xxx.com"]; [end setTextAlignment:NSTextAlignmentCenter]; [end setFont:[UIFont systemFontOfSize:12*kViewRadio]]; [end setNumberOfLines:4]; [self.view addSubview:end];}- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning];}@end
效果
1 0
- IOS - 关于我们页面
- 《关于我们-合作》页面设计问题
- 关于iOS启动页面
- angular+一个简单的页面+有上角有主页+关于我们+联系我们
- 关于我们~
- 关于我们
- 关于我们
- 关于我们
- 关于我们
- 关于我们
- 关于我们
- 关于我们
- 关于我们
- 关于我们
- 关于我们
- 关于我们
- iOS开发关于远程推送页面跳转
- ios 关于页面间的跳转
- 查看与设置mysql的连接数
- IT新技术发展与企业信息化创新特征分析
- 【玩转cocos2d-x之五】导演类CCDirector
- Struts 简介
- [XCode错误]XCode编译出错异常:ld: framework not found Kernel clang: error: linker command failed with e
- IOS - 关于我们页面
- Maven包的冲突问题
- GRE写作必备句型
- 【玩转cocos2d-x之六】节点类CCNode
- 第二种 复选框的写法
- hadoop学习笔记(为什么hadoop的出现)
- 梦想是未来最好的保障
- artDialog提示框、对话框
- HBase表预分区