Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrow image not found #33

Open
alexandre-g opened this issue Dec 2, 2015 · 3 comments
Open

Arrow image not found #33

alexandre-g opened this issue Dec 2, 2015 · 3 comments

Comments

@alexandre-g
Copy link

When installed with CocoaPods

@Darkseal
Copy link
Owner

Hello,
I just tried installing 0.1.34 in a sample project using CocoaPods and I got the arrow image showing.

Chances are you're using a different version?

I would also try setting [showArrowImage:YES] during your view's init.

Check also this issue:
#15

Let me know,

@slxl
Copy link

slxl commented May 1, 2016

@Darkseal the problem is with hard coded bundle name. When use_frameworks! option is set at the Podfile - you won't have that bundle, but framework instead

@mkval
Copy link

mkval commented Sep 13, 2016

I agree with @slxl. I'm using it for a Swift2 project. Pod version is 0.1.34.

Inside DownPicker init, it tries to load a bundled downArrow.png image, and only when it's available, such UIImageView instance is passed to the textField.rightView.

// setup the arrow image
UIImage* img = [UIImage imageNamed:@"downArrow.png"];   // non-CocoaPods
if (img == nil) img = [UIImage imageNamed:@"DownPicker.bundle/downArrow.png"]; // CocoaPods
if (img != nil) self->textField.rightView = [[UIImageView alloc] initWithImage:img];
self->textField.rightView.contentMode = UIViewContentModeScaleAspectFit;
self->textField.rightView.clipsToBounds = YES;

The problem is, if there was no UIImageView instance attached to the textField, calling setArrowImage: method doesn't do anything.

-(void) setArrowImage:(UIImage*)image
{
    [(UIImageView*)self->textField.rightView setImage:image];
}

What i'm doing now to circumvent this is to create a UIImageView instance, which already holds my custom down arrow, and pass it to my textField's rightView property before instantiating a DownPicker object.

NixSolutionsMobile pushed a commit to NixSolutionsMobile/DownPicker that referenced this issue Mar 30, 2017
NixSolutionsMobile pushed a commit to NixSolutionsMobile/DownPicker that referenced this issue Mar 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants