Skip to content

create image selector using the V8HorizontalPickerView #5

@fusjh2o

Description

@fusjh2o

I want to create image selector. selecting one image, the image move to center and hight light. I define the function "- (UIView *)horizontalPickerView:(V8HorizontalPickerView *)picker viewForElementAtIndex:(NSInteger)index" and implement the protocol "V8HorizontalPickerElementState". when I first reloadData, it display normally, later the images don't display. I implement as follows:

pragma mark - HorizontalPickerView Delegate Methods

  • (UIView _)horizontalPickerView:(V8HorizontalPickerView *)picker viewForElementAtIndex:(NSInteger)index
    {
    UIDeviceImageCell *l = [[[UIDeviceImageCell alloc] initWithFrame: CGRectMake(index_80, 0, 80, 80)] autorelease];

    electItem *this = [imageList objectAtIndex: index];
    l.image = [UIImage imageNamed: this.imagename];
    return l;
    }

import <UIKit/UIKit.h>

import "V8HorizontalPickerViewProtocol.h"

@interface UIDeviceImageCell : UIImageView
{

}

@EnD

import "UIDeviceImageCell.h"

@implementation UIDeviceImageCell

  • (void)setSelectedElement:(BOOL)selected {
    }

@EnD

thx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions