DJHomeViewController.m

#import "DJHomeViewController.h"
#import "DJMenuView.h" const CGFloat screenW = ;
const CGFloat screenH = ; @interface DJHomeViewController () @property (nonatomic,weak) DJMenuView *menuView; @end @implementation DJHomeViewController - (void)viewDidLoad {
[super viewDidLoad]; DJMenuView *menuView = [[DJMenuView alloc] init]; [self.view addSubview:menuView];
self.menuView = menuView; // 根据屏幕方向设置menu属性
[self willRotateToInterfaceOrientation:self.interfaceOrientation duration:]; } - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
} /** 当屏幕方向将会发生改变时调用此方法 */
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation)) {
NSLog(@"当前已旋转为横屏");
self.menuView.width = ;
self.menuView.height = screenW; } else {
NSLog(@"当前已旋转为竖屏");
self.menuView.width = ;
self.menuView.height = screenH;
} } @end

横屏:

竖屏:

QQ空间HD(4)-设置左侧菜单栏属性的更多相关文章

  1. QQ空间HD(5)-添加左侧菜单栏内容

    DJIconView.m #import "DJIconView.h" @implementation DJIconView - (instancetype)initWithFra ...

  2. WebStorm设置左侧菜单栏背景和字体设置

    WebStorm左侧菜单栏 webstorm是一款前端IDE利器,个人感觉黑色的背景比较炫酷,刚开始从网上下载的主题只能修改编辑窗口的背景色,经过查询资料终于把左边菜单栏的背景色也修改了. 第一步:点 ...

  3. ClientKey实现登录QQ空间,并设置背景音乐

    ClientKey大家都知道的,通过webbrowser登录后取得Cookie并计算出GTK,即可操作空间的POST. 源代码中引用了苏飞的Http类库,自己修改添加了一些拓展方法. 下载地址:htt ...

  4. WebStorm设置左侧菜单栏背景色和样式

    WebStrom一直以来都是默认的白色主题,今天想修改了下主题皮肤,结果导致左侧项目资源栏和顶部菜单栏也变成了黑色,结果无法改变回来,网上查了各种帖子,居然也没找到解决方法,自己研究了半天,终于搞定了 ...

  5. QQ空间HD(6)-实现自定义的选项卡切换效果

    DJTabbarButton.m #import "DJTabbarButton.h" @implementation DJTabbarButton - (instancetype ...

  6. QQ空间HD(1)-UIPopoverController基本使用

    UIPopoverController 是iPad的专属API ViewController.m #import "ViewController.h" #import " ...

  7. QQ空间HD(3)-Modal的切换效果总结

    - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { UIViewController ...

  8. QQ空间HD(2)-UIPopoverController其它使用

    DJTestViewController.m #import "DJTestViewController.h" #import "DJColorTableViewCont ...

  9. 长姿势 教你在qq空间上显示iPhone6尾巴

    下午刚午休完的时候,广州很多童鞋都感受到了震感,半青也感受到了,不仅如此,我还感受到了更大震感,那就是翻一下QQ空间动态,竟然看到有一位好友的尾巴竟然显示为“iPhone6”,顿时觉得该好友逼格太高了 ...

随机推荐

  1. 【codevs1043】 方格取数

    http://codevs.cn/problem/1043/ (题目链接) 题意 N*N的方格,每个格子中有一个数,寻找从(1,1)走到(N,N)的两条路径,使得取到的数的和最大. Solution ...

  2. 多线程 thread和Task的用法以及注意事项

    并行 多核线程:Task 首先引用System.Threading; 1:用静态方法:Task.Factory.StartNew()来创建了一个最简单的Task: Task.Factory.Start ...

  3. python——复制目录结构小脚本

    引言 有个需要,需要把某个目录下的目录结构进行复制,不要文件,当目录结构很少的时候可以手工去建立,当目录结构复杂,目录层次很深,目录很多的时候,这个时候要是还是手动去建立的话,实在不是一种好的方法,弄 ...

  4. 使用uWSGI部署django项目

    先说说什么是uWSGI吧,他是实现了WSGI协议.uwsgi.http等协议的一个web服务器,那什么是WSGI呢? WSGI是一种Web服务器网关接口.它是一个Web服务器(如nginx)与应用服务 ...

  5. iOS自动处理键盘事件的第三方库:IQKeyboardManager

    我们写界面要考虑很多用户体验问题,键盘事件的响应就是比较麻烦的一种.我们需要监听键盘事件,考虑点击背景收起键盘.考虑键盘遮挡输入框问题等等,而且每个界面都要做这么一套.这个库帮我们解决了这个事情. 这 ...

  6. Python基本数据类型之dict

    一.创建字典: d = { "name": "morra", #字典是无序的 "age": 99, "gender": ...

  7. 堆优化的Dijkstra

    SPFA在求最短路时不是万能的.在稠密图时用堆优化的dijkstra更加高效: typedef pair<int,int> pii; priority_queue<pii, vect ...

  8. Base64复习

    http://www.cnblogs.com/chengxiaohui/articles/3951129.html

  9. Linux安装配置sun-java

    一(不推荐) 1. 下载源码与解压 将下载的源码包,移动到/opt目录下: $ sudo mv ~/Downloads/jdk-8u65-linux-x64.tar.gz  /opt/ 解压: $ s ...

  10. ELKstack搭建

    开源实时日志分析ELK平台部署 官网地址:https://www.elastic.co/products 介绍: Elasticsearch是个开源分布式搜索引擎,它的特点有:分布式,零配置,自动发现 ...