view is different on canvas and on simulator - objective-c

Look at the titles of the buttons. Also the placing of the 1 at the bottom.
Any idea what can cause that? (All I did was to drag and drop and wrote some simple calc code)

In your picture, there are blue lines to the bottom and left of your 1 button. This means that your button is aligned to the bottom left of the screen.
The rest of your buttons are probably aligned with the top of the screen. This means that if height of the screen changes, your buttons will not line up. If you align the button to the top of the screen you shouldn't have this issue.
You can change the alignment by moving the button to the top of the screen so that the blue line is at the top and then dragging it back down to where you want it, or you can change it in the Size Inspector.
As for the issue of missing titles, it looks like somehow the buttons with missing titles have strange constraints that cause the titles to disappear when the screen is getting laid out. I was able to get rid of the issue by deleting all but the first row of buttons, selecting that first row and duplicating it 4 times for the other rows. This ensures that all the buttons are lined up perfectly. A couple of your buttons had a width of 71 instead of 64 which might have been causing them to be laid out poorly.

Related

Powerpoint VBA Positioning listview

I am trying to get 2 listview objects to work on a powerpoint slide. I can place them anywhere on the slide, but when I start the slideshow, 2 smaller copies appear in the upper-left corner. Text added to the listview appear in the upper-left boxes. I can't select the original listview either.
How can I prevent the 2 copies from showing up so I can work with the listviews I positioned on the slide?
The slide
http://prnt.sc/ectyx6
The Slideshow
http://prnt.sc/ectz8u
I looked into it a bit, and I think it's just a glitch with the Listview control.
From my tests, the actual Listview control was smaller then the original, but the top left position was correct (after the first time in reading/presentation view). I assume the they are smaller because it doesn't have a zoom property, and the slide is stretched to fit the window.
If you really want a Listview...which I hate to call into question, but think is warranted...then you can just Insert a Rectangle without a border over the Listview control to hide the original placeholder. The real Listview will still get drawn on top.
I think this is just the beginning of your troubles with a Listview control in PowerPoint...are you sure that you need it. Maybe linking to an Excel file with the Listview would be better, or some use of animation.

UIButtons Alignment

I am trying to implement like word cloud in my app.
The image shown is like word cloud with left alignment.
What I did was, for placing the buttons I am checking whether the width of the text is greater than total width of the screen, if it is greater place the button in next row i.e increment the y position, if it is not just place the buttons. Everything is working fine. But what I want now is , i want to move the buttons alignment, like, I want to start the first button from center of the screen. Please help me to do this...

Apples keyboard appears then scroll code sample does not work correctly

I have a UITableView with a navigation bar on top. I have several text fields in the cells and if i click in the cell at the bottom the keyboard hides the text field. So I googled and found this link: http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html#//apple_ref/doc/uid/TP40009542-CH5-SW7
I used exactly that code and run my app again. Now it scrolls up (about the height of the keyboard) instead of scrolling down. Also it scrolls in every cell, even the cells at the top which will not get hided by the keyboard. Does anyone have a solution for this? I tried to log out some coordinates inside the keyWasShown: method but it's very complex for me to figure it out.
So I used trial and error and finally found out, that I have to add two superview properties behind activeField:
activeField.superview.superview.frame.origin
Do this behind every activeField in the method keyboardWasShown: and it will work. Ah and I added 70 pixels, because the view didn't scroll exactly where I wanted it to, maybe it is because of the navigation bar I use, I don't know:
activeField.superview.superview.frame.origin.y - kbSize.height + 70

How do I expand a window to show more content in cocoa

I'm building an application in Cocoa and I want to be able to let the user click a button, which expands the window size showing content that was previously hidden.
For example, the top 68 pixels of my application show a summary of what is happening (like syncing data to a server) and there's a button off to the right that when clicked expands the window down and let's the user enter more information.
Problems I'm having are.
1) the background image I setup by subclassing NSImageView seems to be originated at the bottom left corner instead of the top left, so my button which should be over the right corner a the top of the background starts off over the right corner at the bottom of the background.
2) The window expands down and the button floats up. So the button starts at the bottom right corner and ends up at the top right corner. I want it to be in the top right corner always.
I think all of this would be solved if I could figure out how to tell the window to start at the top left corner and grow down, but not move controls around, simply hide them if the window isnt big enough.
Thoughts?
If I understand your question right then this should be it:
1) it is so because the coordinate system on mac is with the origin on bottom left. I think you should just move your image view up a little when you're resizing.
2) When you expand the window the buttons frame is based with the origin on the bottom left corner so again you will need to offset it when the view grows.
I think that by using auto layout and setting up the proper constraints things might be a little easier :)

Possible bug in Interface Builder?

I've a window with a horizontal split view. On the bottom pane of the split view, I have a nssegmentedcontrol, aligned to the center. On the bottom of the nssegmentedcontrol I have 5 tabs that are controlled by the segmented control - click in one of the cells and the corresponding tab opens.
My problem is, if I completely minimize the bottom pane, to the point where the dividing line touches the bottom of the window, the segmented control gets pushed on top of the table header and never goes back to its original place.
I've tried fiddling with IB to get this to work, but no luck. Has anyone experienced this?
Following what's on the comments, I replaced the default split view with the one found in BWToolkit that allows for the definition of minimum and maximum height of each view.
BWTookit is a no go, the framework leakes a lot.
You should use RBSplitView (google it), it also gives you option for min and max height
and I started using it because of a bug in the split view as well, I used it for a chat window
but the split view didn't autosave as it should, every time it got like 2px smaller,
RBSplitView is great, and doesn't leak.