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. Java线程与并发库高级应用-线程范围内共享数据ThreadLocal类

    1.线程范围内共享变量 1.1 前奏: 使用一个Map来实现线程范围内共享变量 public class ThreadScopeShareData { static Map<Thread, In ...

  2. SPOJ ORDERSET - Order statistic set

    ORDERSET - Order statistic set   In this problem, you have to maintain a dynamic set of numbers whic ...

  3. matlab之meshgrid()函数

    以最常见的一个用法为例: [X,Y]=meshgrid(xgv, ygv) xgv是一个(一维的,行)向量,ygv也是. 产生的X和Y,规格相同,都是二维向量,高度为size(ygv,2),宽度为si ...

  4. 【codevs1743】 反转卡片

    http://codevs.cn/problem/1743/ (题目链接) 题意 给出一个序列{a1,a2,a3···},要求维护这样一种操作:将前a1个数反转,若第a1等于1,则停止操作. Solu ...

  5. codeforces 21D:Traveling Graph

    Description You are given undirected weighted graph. Find the length of the shortest cycle which sta ...

  6. System.BadImageFormatException: 未能加载文件或程序集""或它的某一个依赖项。试图加载格式不正确的程序。

    解决方法: 1.更改程序集的生成目标平台为[Any CPU],或者针对平台进行编译. 项目右键->[属性]->[生成]->[生成目标平台] 2.尝试一下修改线程池设置为32位支持.

  7. windows核心编程读后感(待续)

    自从大一读那本超厚的C程序设计以后,从来没有像这样慢慢地读一本书了.windows核心这本书足足看了2个多星期.一张张慢慢看,做笔记.感觉学到了很多基础的知识,关于内核方面的没有啥可以做实验的,都在看 ...

  8. C# 获取当前,相对,绝对路径

    一.C#获取当前路径的方法: 1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName -获取模块的完整路径. 2. ...

  9. sql like

    在java里面写sql要用 like CONCAT('%',?,'%')

  10. django 模板中url的处理

    在模板中直接添加‘/home’这样的链接是十分不推荐的,因为这是一个相对的链接,在不同网页中打开可能会返回不一样的结果. 所以推荐的是 <a href="{{ object.get_a ...