Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 3, 2013, 01:12 PM   #1
Trisect Develop
macrumors newbie
 
Join Date: Jun 2013
Location: Denmark
Funny behavior of ImageView

I have an ImageView in my application.
When I load an image into my ImageView I change the size of it with the SetFrame command, and that seems to work okay.
I make the ImageView bigger.

On my window form I also go a NSPopupButton and when I click on it my ImageView set its frame to the starting value. Its going back the the size it has when I start my application.

I have tried many things but I can figure out why it shrinks my ImageView back.

Does any one here know why is is like that?
Trisect Develop is offline   0 Reply With Quote
Old Jul 4, 2013, 08:59 AM   #2
Trisect Develop
Thread Starter
macrumors newbie
 
Join Date: Jun 2013
Location: Denmark
I have tried to set breakpoints on every line that includes the setFrame command, but no code gets called when I click in my NSPopUpButton.

I really hope that someone can help me.
Trisect Develop is offline   0 Reply With Quote
Old Jul 4, 2013, 11:27 AM   #3
xStep
macrumors 68000
 
Join Date: Jan 2003
Location: Lost in Minneapolis
If you used Interface Builder (IB) and the button is a part of that construction, then select the button in IB and check the connections panel. Is the button connected to any outlet or action. If connected to an action, place a break point on the first line of the method. If not an action, but an outlet, check all references to the outlet (instance variable) and see if you are assigning a action to it.

If the above doesn't reveal anything, then try turning off AutoLayout for that IB view. I mention this as a shot in the dark.

You may need to post some code or screen shots for people to help further.

That's all I have.
__________________
My App: CameraTime - Time lapse photography for novice and advanced users.
xStep is offline   0 Reply With Quote
Old Jul 4, 2013, 01:05 PM   #4
Trisect Develop
Thread Starter
macrumors newbie
 
Join Date: Jun 2013
Location: Denmark
Sadly the Autolayout idea did not work.

This is the code for the action for the popupbutton.
Code:
 
   [ivTemporyImageAA setFrame:bigScreenshot];
    
    NSLog(@"height=%f", ivTemporyImageAA.frame.size.height);
    NSLog(@"widht=%f", ivTemporyImageAA.frame.size.width);
I set the frame for my ImageVIew and display the size in nslog.

This is how I set the sized in applicationDidFinishLoading.
Code:
    smallIcon = NSMakeRect(262, 257, 100, 100);
    bigScreenshot = NSMakeRect(262, 98, 155, 259);
So when I load an image into my ImageView it size is set to bigScreenshot and it look okay on the screen.

Then when I select a value in my popupbutton and called the previous code the ImageView gets small again. Ignoring the code in the action.

The nslog show the right values, but something after the nslog code resize the ImageView back to the small size.
Trisect Develop is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:31 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC