如何让NSSplitView的子View的大小固定
来源:互联网 发布:男士皮衣品牌 知乎 编辑:程序博客网 时间:2024/06/07 23:59
问:
How can I make fixed width of the left pane in the NSSplitView?
I want to make it as in iTunes. When user resize a window only right pane should change width.
回答:
Your split view delegate should implement the following method:
-(void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize: (NSSize)oldSize
{
CGFloat dividerThickness = [sender dividerThickness];
NSRect leftRect = [[[sender subviews] objectAtIndex:0] frame];
NSRect rightRect = [[[sender subviews] objectAtIndex:1] frame];
NSRect newFrame = [sender frame];
leftRect.size.height = newFrame.size.height;leftRect.origin = NSMakePoint(0, 0);rightRect.size.width = newFrame.size.width - leftRect.size.width- dividerThickness;rightRect.size.height = newFrame.size.height;rightRect.origin.x = leftRect.size.width + dividerThickness;
[[[sender subviews] objectAtIndex:0] setFrame:leftRect];[[[sender subviews] objectAtIndex:1] setFrame:rightRect];}
- 如何让NSSplitView的子View的大小固定
- 如何让textarea的大小固定
- 如何让frame的大小固定,不能被用户改变?
- NSSplitView 左右滑动时,两边的Control同时改变大小
- 如何让view上的子view不透明
- 如何让高度不固定的list的子Item高度充满list
- android 重写GridView,让子View能够按指定的大小展示
- view上创建dialog,如何让dialog自动适应view的大小
- 如何固定QT窗口的大小
- Android里面如何固定字体的大小
- html/jsp如何固定图像的大小
- 单文档拆分的子窗口大小固定
- VC中让窗口固定大小的一段代码
- 如何动态获得view的大小
- iframe如何让父页面根据子页面的大小而动态为子页面留出空间
- MFC中如何创建固定大小的窗口
- 如何打开一个固定大小的页面? (转)
- 在Qt 4中如何固定窗口的大小
- zoj 1015 Fishing Net//弦图的判定
- 关于SCN号
- Java JDBC编程总结
- 图像处理的基本算法
- <二>基于Fourinone实现分布式计算完整demo
- 如何让NSSplitView的子View的大小固定
- SQL開發經典筆記
- 全局类型转换器
- Spring AOP 详解
- ACPI中ASL的简单介绍
- 全球首款LTE TDD/UMTS/GSM/CDMA多模数据卡 华为E392即将商用
- 在Ubuntu上下载、编译和安装Android最新内核源代码(Linux Kernel)
- jQuery设计思想
- ubuntu下vbox挂载共享文件夹