1
我讀蘋果的樣本代碼在:的NSView變化NSScrollView
http://developer.apple.com/library/mac/#samplecode/CocoaSlides/Introduction/Intro.html
它的工作原理上的NSView
#import <Cocoa/Cocoa.h>
@class Asset;
@class AssetCollection;
// An AssetCollectionView displays the contents of an AssetCollection
@interface AssetCollectionView :NSView
{
// Model
AssetCollection *assetCollection;
// Controller Glue
NSMutableArray *nodes;
// Appearance Attributes
NSGradient *backgroundGradient;
// UI State
BOOL autoCyclesLayout;
NSTimeInterval layoutCycleInterval;
NSTimer *layoutTimer;
int subviewsLayoutType;
NSArray *sortDescriptors;
BOOL slidesHaveShadows;
BOOL usesQuartzCompositionBackground;
}
- (AssetCollection *)assetCollection;
- (void)setAssetCollection:(AssetCollection *)newAssetCollection;
- (BOOL)autoCyclesLayout;
- (void)setAutoCyclesLayout:(BOOL)flag;
- (NSTimeInterval)layoutCycleInterval;
- (void)setLayoutCycleInterval:(NSTimeInterval)newLayoutCycleInterval;
- (int)subviewsLayoutType;
- (void)setSubviewsLayoutType:(int)layoutType;
- (NSArray *)sortDescriptors;
- (void)setSortDescriptors:(NSArray *)newSortDescriptors;
- (BOOL)slidesHaveShadows;
- (void)setSlidesHaveShadows:(BOOL)flag;
- (BOOL)usesQuartzCompositionBackground;
- (void)setUsesQuartzCompositionBackground:(BOOL)flag;
- (void)reloadData;
@end
但我更喜歡的NSView改變NSScrollView,我可以看到縮略圖窗外。
但是,如果我從
@interface AssetCollectionView :NSView
改變代碼
@interface AssetCollectionView :NSScrollView
AssetCollectionView將無法顯示。
歡迎任何評論