I have a IU button that has an image, when I run on the simulator everything shows up and is working. however once I try to run on the device the button is not there. I already checked for case sensitivity, if its in the bundle phase, changing the button from "weak" to "strong", checking the button alpha and still no luck. Any other suggestions? Thanks.
update.
so now I tried to delete the image and add text to the button to see if the button will show with text(on the device). The button is still visible on the simulator but on the device I get no text, no button. So now my question is, what could be possible reasons a UI button would show on the simulator but not the device?
I also used a previous app as a test, I added a button and ran it on the same device and the button showed up with the same image I am trying to implement. so I am lost as to why its not working on my current app.
Related
In Xcode 11, there are two buttons next to the device preview. The one on the top we all know is the Live Preview. However the one on the bottom does not seem to be doing anything. Why would Apple leave a completely useless button there? Am I missing out some awesome functionality?
The button icon looks like it could be related to constraints... but I don't know.
This button lets you to instantly run the app on an attached device so you can see the live changes directly on your device instead of Xcode's canvas preview.
Note that you need iOS 13 installed on your device to be able to use this capability.
This is driving me nuts.
My app was running normally and then I don't know what I did but any changes I now make in the storyboard/ IB/ Xibs etc are not updating when I run the app either on real device or simulator. For instance, I changed the textColor of UILabel but when I run the app, the old color still shows both on device or simulator. I am using Xcode Version 7.3.1.
Please help. Thanks
This solution had worked for me:
Just delete that storyboard in which changes are not reflecting and take new storyboard instead it will start reflecting changes.
When you have the simulator open.
Click and hold down your app icon
When you seen the icons shaking and "X" in their Top Left, Click to delete it
Do the same for any other App Icons you may have showing in the Simulator Home screen
In Simulator menu at top - Click "HardWare" -- "Home" to stop icons shaking
In same menu Click "HardWare" -- "Reboot" (Wait for this to complete)
Quit Simulator from its menu "Quit Simulator"
(nb: when using device to run app, I would delete it from app as well)
Then Go back to Xcode
click in to menu "Product" -- "Clean"
Quit Xcode and open up again
Run Simulator on the iPhone Simulator Size you just cleaned out (above)
I've tried to simulate the issue you're having but unable to, however, when I have any issues on running my apps, the above seems to work.
[ Sometimes Xcode can be a bit slow, so I tend to wait a few seconds to confirm it / Xcode has actioned it, as I sometimes used the keyboard too fast for it to keep up.]
Hope this helps!
Hopefully to save someone some frustration, I had this same problem and figured out that I must have accidentally hit Command+d while trying to copy something and duplicated the scene. The duplicate was laid perfectly over the original so I couldn't tell I was editing the duplicate instead of the actual scene linked to my navigation controller. I was so focused on the problem I didn't notice the new warning for an unreachable scene in my storyboard.
When my Main.storyboard was not saving (its file icon remained grey after clean+build), I found that running git add -u and git commit -m "//your comment" in my terminal would change the Main.storyboard file icon to yellow again (not grey)
Try removing all constraints from the changes you made and then reapply them. That is what worked for me.
I am trying to follow some tutorials online. Every time i run the iOS simulator my xcode seems to minimise and focus goes to the simulator on the desktop
Is it possible to stop this and have the simulator load on top of the Xcode window?
Thanks
Focus will switch over but Xcode itself doesn't minimise. However, if you're running Xcocde full screen (you have clicked on the <-> arrow in the top right of the screen) then you will switch to a different screen - this is standard behaviour for all maximised apps. Clicking on the green full screen icon in Xcode will make the window take up all available space but without taking a separate screen, which will give the behaviour that you want -- though note this is for 10.9; I seem to recall that clicking the green button on later versions of OSX may automatically trigger the full/separate screen mode.
So here is my problem:
I am building an iPhone app (not universal) for deployment on iOS 7.0. In my very first View Controller I have two buttons. Both buttons are set as "Custom" and just contain a text png I made in Illustrator as the image for the button. My first button works great. It has both the #2x version and the normal version in the Image.xcassets folder under its own icon name. My next button work exactly the same way, except with different text file. It was created the same way. It looks great inside the storyboard, but when I run my app on either a simulator or an actual device, the 2nd button resizes itself. I have no clue how to fix this.
So far I have tried cleaning the project, restarting Xcode, reinserting the image file, playing with the button properties inside of the storyboard, and turning OFF auto layout.
Here is a screenshot of the simulator running next to the storyboard view in Xcode:
It sounds like the Attributes > View > Mode on the second button may be set differently, but you mentioned you have tried adjusting setting. Try deleting the button that is not working, duplicating the one that is working and changing the image in the duplicate to the second image.
To be sure there is not something unusual going on with your image (can't really imagine what), have you tried using the image that is shrinking in the button that seems to be ok?
You can also click on the "Resolve Auto Layout Issues > Reset to Suggested Constraints" to see if that helps. You can also try clearing all constraints and resetting them via that same menu.
I have an app that uses button images that are being changed as the user interacts with the button.
I just converted my app to iOS7 in Xcode 5, but now my button images are not showing any more. All I see is a bright blue square where the button should be.
When I change the tint from blue to clear, the buttons show, but the button does not change when I push it.
The images are still in my supported files folder and should be properly used by Xcode...
Does anyone have a similar issue? Can this be fixed easily?
There is a new button type called UIButtonTypeSystem with iOS 7.
On your .xib file, change the button type to Custom.