English 中文(简体)
内容方面的超声波发射器
原标题:Overlay NSScroller over content

是否有任何办法可以超越国家航空航天局网站的内容(如SOS)。 我已经尝试过几个办法:

a> 规定了滚动观点(NSClipView)的范围,以延伸至滚动器的束缚。

b> 添加一个NSScroller物体,作为滚动观点的子目表(在我想要时的位置)

<>strong>c>,形成一种全方位的习惯动向,将其列为一种分观点(这既有效,又意味着我需要改写国家安全局的所有功能)。

Sparrow 似乎在成功这样做,似乎通过一个固定的NSScroller子级(见它响应了系统优惠和优惠制设定的滚动环境;以及预留)。 它没有真正地推导出引起这一问题的滚动器,只是把它压倒了内容。

任何建议都得到赞赏:

最佳回答
问题回答

Here is my solution : Create a MyScroller class that extends NSScroller

在MyScroller.m:

#import "MyScroller.h"


@implementation MyScroller

+(CGFloat) scrollerWidth{
    return 10;
}

+(CGFloat) scrollerWidthForControlSize:(NSControlSize)controlSize{
    return 10;
}

- (void) drawBackground:(NSRect) rect{
    NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:0 yRadius:0];
    [[NSColor whiteColor] set];
    [path fill];
}

- (void)drawKnob{
    [self drawBackground:[self rectForPart:0]];
    [self drawBackground:[self rectForPart:1]];
    [self drawBackground:[self rectForPart:2]];
    [self drawBackground:[self rectForPart:4]];
    [self drawBackground:[self rectForPart:5]];
    [self drawBackground:[self rectForPart:6]];


    NSRect knobRect = [self rectForPart:NSScrollerKnob];
    NSRect newRect = NSMakeRect((knobRect.size.width - [MyScroller scrollerWidth]) / 2, knobRect.origin.y, [MyScroller scrollerWidth], knobRect.size.height);
    NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:newRect xRadius:5 yRadius:5];
    [[NSColor grayColor] set];
    [path fill];
}
@end

然后,在Interface Buildinger为Schroller设定了习惯等级。

页: 1 意见控制<代码>.overlay,以便产生预期的超支效果。

这可能推翻了系统环境中的系统广泛环境,从而提高产品可见度。 为了在你服用时保持滚动条码的变化,你必须遵守<条码>。 NSScroller.p referredScrollerStyleDidChange NOtification,并重新应用超支效应。





相关问题
Asynchronous request to the server from background thread

I ve got the problem when I tried to do asynchronous requests to server from background thread. I ve never got results of those requests. Simple example which shows the problem: @protocol ...

objective-c: Calling a void function from another controller

i have a void, like -(void) doSomething in a specific controller. i can call it in this controller via [self doSomething], but i don t know how to call this void from another .m file. I want to call ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

NSUndoManager and runModalForWindow:

I have a simple Core Data app which displays a list of entities in the main window. To create or add new entities, I use a second modal window with a separate managed object context so changes can be ...

NSMutableArray values becoming "invalid"

I m trying to show a database information in a tableview and then the detailed information in a view my problem is as follow: I created a NSMutableArray: NSMutableArray *myArray = [[NSMutableArray ...

iPhone numberpad with decimal point

I am writing an iPhone application which requires the user to enter several values that may contain a decimal point (currency values, percentages etc.). The number of decimal places in the values ...

热门标签