• dfdfdfdffdfdfdfdsfa


    pokki.addContextMenuItem(text,identifier)

    Textual string to display to users in the context menu item

    identifier   Internal identifier used when listening for context_menu event.

    Adds a menu item to your app's   context menu during run-time;

    pokki.addEventListener('event_name', function(){});

    event_name   The event to listen for.

    function    Afunction or the name of a function to call  when the events is fired.

    1 context menu   Fires when the user selects a developer defined item 

    in the context menu; pass the identifier associated with the menu item

    hidden   Fires after the hiding event, once the app window is not visible

    hiding Fires as the minimizes due to a usr action 

    link Fires when the url of the window is changed or a new window tries to be open ed from 

    the popup;

    passes the URL trying to be opend , and ignores the request

    showing   Fires when the user clicks on your app's icon and the app window animates in 

    shown   Fires after the showing event, once the app window is done animating in 

    unload  Fires four seconds before the app and both it's page are unloaded by pokki

    work_area_change Fires when the work area changes due to a user changing their display resolution

    fullscreen Fires when user presses the full screen button in the window title bar

    pokki.clearWebSheetCookies

    clears cookies and local  storage associated with web sheets used in yur app.

    pokki.hide();

    Minimizes the app window if it's currently shown,  may only be called from the window page.

    pokki.descramble(scrambled_data)

    Used to descramble data.

    pokki.getScrambled(key)

    retrieves and descrambles data from your app's manifest file.

    The data is identified with a key. If your app is 

    bing developed locally and isn't yet packaged  meaning your data ism't 

    scrambled  

    pokki.getWorkAreaSize

    returns an object with the dimensions of the available work area. The work area is the 

    is the maximum portion of the sreen that a popup window may use.

    pokki.hideWebSheet

    closes any open web sheet displayed in the popup window.

    pokki.isShow()

    Used to queyer whether or not the app window is currently visible.

    pokki.show();

    Opens the app window; may only be called within 5 second of the context_menu event

    fireing 

    pokki.openURLInDefaultBrowser

    The URL to open in the user's prefrerred web browser.

    pokki.removeIconBadge

    removes the badge displayed on your app's icon in the taskbar

    pokki.resetContextMenu

    pokki.resetContextMenu

    removes context menu items that were defined in the maifest file or added 

    during 

    pokki.rpc

    a string containing Javascript commands to run in the context of  the opposing page 

    pokki.rpcArgs

    pokki.scramble(data);

    An arbitrary complex Js object to obfuscate.

    Used to obfuscate sensitive data during run-time ,   

    pokki.setIconBadge(number);

    pokki.setWindowFeature(feature,value);

     The name of the feature being modified    

    Used to configure window features on a per app basis  The fowwloing features are supported.

    1 fullscreen   Pass rue if the app currently supports full-screen or false to specify it can not.

    May be called multiple times throup the app's runtime 

    aspect Pass a decimal to specify the aspect ratio to hich the window is locked whilc the user resizes.  

    pokki.showWebSheet(url,width,height,loading_callback,error_callback)

    ;a 

    a  web sheet is a chromeless browser embedded in the popup that is intended to be used with OAuth 

    and similar protocols for authentication

    The popup window is temporarily resized to rit the specified width and height

    and will restore its original dimensions when the web sheet is hidden.

    The web sheet will be displayed once the initial page is loaded as specieied by the url parameter

    collects data for a series of clinical trials

    sliders themselves are UISliders,

    #import<UIKit/UIKit.h>

    @interface PANASTableSliderCell:UITableViewCell

    @property (nonatomic, strong) IBoutlet UILabel *sliderLabel;

    @property (nonatomic,strong) IBoutlet UISlider *slider;

    @end

    tableView:cellForRowAtIndexPath: deals with the creation of the ten slider cells.

    if(indexPath.section == 1) {

      NSArray *topLevelObjects = [[NSBundle mainBundle] lodNibNamed:@"PANAS"]

    }

    TableSliderCell"  owner:nil  options:nil];

    PANASTableSliderCell *pCell = [topLevelObjects objectAtIndex:0];

    pCell.slider.tag = indexPath.row;

    pCell.slider.minimumValue = 0.0;

    pCell.slider.maximumValue = 4.0;

    pCell.slider.continuous = NO;

    [pCell.slider addTarget:self action:@selector(sliderDidChange:) forControlEvents:UIControlEventValueChanged];

    pCell.sliderLabel.text = [sliderNames objectAtIndex:indexPath.row];

    [pCell setSelectionStyle:UITableViewCellSelectionStyleNone];

    pCell.slider.value = [[sliderValues objectAtIndex:indexPath.row] floatValue];

    return pCell;

    loading the nib file  and exracting the PANASTableSliderCell 

    -(IBAction)sliderDidChange:(id)sender {

      UISlider *slider = (UISlider *)sender;

      int sliderIntValue  = (int)slider.value;

      float sliderModValue = (float)sliderIntValue;

      if((slider.value - sliderModValue) > = 0.5) {

        sliderModValue ++;

      }

    slider.value = sliderModValue;

    [sliderValues replaceObjectAtIndex:slider.tag withObject:[NSNumber numberWithInt:sliderModValue]];

    }

    Adding Gestures to Cells

    cellForRowAtIndexPath:

    -(UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

      static NSString *cellIdentifier = @"cellIdentifier";

      UITableViewCell *cell = [theTableView dequeueReusableCellWithIdentifier:cellIdentifier];

      if(!cell) {

        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];

        UITapGestureRecognizer *doubleTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didDoubleTapCell:)];

        doubleTapRecognizer.numberOfTapsRequired = 2;

        [cell addGestureRecognizer:doubleTapRecognizer];

        return cell;

      }

    }

    -(IBAction)didDoubleTapCell:(UITapGestureRecognizer *)sender {

      UITableViewCell *cell = (UITableViewCell *)sender.view;

    }

    How Swiping Works

    swipe - to- reveal in cells is actually quite simple 

    Your need two views of the same size as the cell   on which is displayed when the cell is created   and the other which is the view that gets revealed as the topView swipes ot    

    stacked on top of each other.  Strictly speaking  UIVews d ehavior in the photoshop senselayer bon't have

    but stacking the cells mimics it 

    UISwipeGestureRecognizerDirectionRight

    swipeView topView

    UISwipeGestureRecognizerDirectionLeft

    its target a method that animates the movemonent of the views by changing their frame  topView starts with a frame origin of (0,0) and ends up with an orign of (320,0)

    adding little visual tweaks that make the views appear to bounce as they move in and out of place  

    fake momentum to the animation can make it seem considerably more realistic 

    #import <UIKit/UIKit.h>

    @interface SwipeCell:UITableViewCell

    @property (nonatomic, strong) UIView *swipeView;

    @property(nonatomic, strong) UIView *topView;

    -(IBAction)didSwipeRightInCell:(id)sender;

    -(IBAction)didSwipeLeftInCell:(id)sender;

    @end

    -(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier

    {

      self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];

      if(self) {

        NSLog(@"self.contentView.width = %f", self.contentView.frame,size.width);

        _topView - [[UIView alloc] initWithFrame:CGRectMake(0,0,self.contentView.frame.size,width,80)];

        [_topView setBackgroundColor:[UIColor whiteColor]];

        UILable *label = [[UILabel alloc]initWithFrame:CGRectMake(10,20,150,40)];

        [label setFont:[UIFont fontWithName:@"Zapfino" size:18]];

        [label setTextColor:[UIColor blackColor]];

        [label seText:@"Swipe me!"];

        [_topView addSubview:label];

        UIImageView *pointImage = [[UIIMageView alloc]initWithImage:[UIIMage imageNamed:@"point"]];

        _swipeView = [[UIView alloc] initWithFrame:CGRectMake(0,0,self.contentView.frame,size.width,80)];

         [_swipeView setBackgroundColor:[UIColor darkGrayColor]];

        UILabel *haveSwipedlabel = [[UILabel alloc]initWithFrame:CGRectMake(10,25,200,30)];

      [haveSwipedlabel setFont:[UIFont fontWithName:@"GillSans-Bold" size:18]];

      [haveSwipedlabel setTextColor:[UIColor whiteColor]];

      [haveSwipedlabel setText:@"I've benn swiped!"];

        [_swipeView addSubview:avaSwipedLabel];

        [self.contentView addSubview:_swipeView];

        [self.contentView addSubview:_topView];

          UISwipeGesureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(didSwipeRightInCell)];

          [swipeRight setDirection:UISwipeGestureRecognizerDirectionRight];

          UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(didSwipeLeftInCell:)];

          [swipeLeft setDirection:UISwipeGestureRecognizerDirectionLeft];

          [self addGestureRecognizer:swipeRight];

          [self addGestureRecognizer:swipeLeft];

          [self setSelectionStyle:UITableViewCellSelectionStyleNone];  

      }

      return self;

    }

    responding to the Gestures

    UIView's fantastically -useful block-based animation methods to move things around.

    OBJECTIVE -c BLOCKS

    Blocks are a feature that was introduced to objective -c in version 2.0   closures and lambas.

    a number of UIView methods due for deprecation that will been replaced by block-based methods   

    A block is discrete chunk of code  that can be passed around much like a variable. your can recognize them by the  ^ operator. 

    BOOL (^myBlock)(int) = ^(int theVariable) {

      [doSomethingWith:theVariable];

    };

    Blocks come into their own where you have chunks of code that need to be executed to perform tasks that are best rn asynchronously. 

    animations are one example, but blocks are used extensivel in other areas such as networking.

    -(IBAction)didSwipeRightInCell:(id)sender {

      [UIView animateWithDuration:1.0 animations:^{

        [_topView setFrame:CGRectMake(320,0,320,80)];

      } completion:^(BOOL finished) {

        [UIView animateWithDuration:0.15 animations:^{

          [_swipeView setFrame:CGRectMake(10,0,320,)]

        }]

      }]

    }

  • 相关阅读:
    涡轮增压中冷器
    TortoiseSVN文件及文件夹图标不显示解决方法
    无线路由器无法登录管理界面,怎么办?
    TP-LINK-TL-WVR450G路由器经常断网
    阿里云DNS地址
    农村社保和职工社保能同时交吗?
    电视机顶盒遥控器可以同时遥控电视和机顶盒
    各种汽车的高端品牌
    金蝶云星空系统打印提示:对象不支持“SetGraphicsMode”属性或方法
    怎么去掉视频的背景音乐?
  • 原文地址:https://www.cnblogs.com/yushunwu/p/2787881.html
Copyright © 2020-2023  润新知