Xamarin Forms iOS images not showing - ios

I have some Button with Image Property like that
<Button Image="Arrow_Left_40.png" Clicked="WocheZurueck_Clicked" WidthRequest="60" HorizontalOptions="Center"/>
and I have that Image in Resources folder in the iOS Project but I dont see the image...

Related

Display static image from iOS filesystem

I am currently trying to display a static image within my react native app. I am using the Image Component from React Native, so there is nothing custom.
Maybe important to mention is that i am opening the Main App with my Share Extension => Image Gallery, Select Image, Share with Main App.
On the Simulator it works just great, when i am using a real device nothing is displayed. Here is the Image path i am trying to display:
<Image
style={styles.image}
source={{
uri: "/private/var/mobile/Containers/Data/PluginKitPlugin/156268E6-6BE0-4055-BF0E-0EDC546FC2F9/tmp/RNSE_TEMP_IMG.png",
isStatic: true
}}
/>
I have tried adding file:// + /private.... but this did not help at all.
Any ideas?

ImageView in Xamarin.iOS LaunchScreens: Set image

I want to change/set the image in my launch screen for my Xamarin.iOS App.
Opening LaunchScreen.storyboard in my Visual Studio 2017 (Win10), I get the storyboard editor as expected.
But if I want to change (or even set) the Image-Property of the default ImageView (or a newly added one), the default file open dialogs comes up - and no matter what image file I select, nothing changes.
Do the images for the launch screen storyboard comply some criteria? e.g. filetype? location?
Update:
This is the property I try to set with an image:
As files I tried several PNG images - all working well as images in my normal Xamarin Views or as Icons.
I think your problem is that you can try this way,rebuild your project when you create a new xarmain.ios project.
Try the following steps

Error ITMS-90717: "Invalid App Store Icon"

When I tried to submit an App to Itunes Connect I got the following error.
iTunes Store Operation Failed
Error ITMS-90717: "Invalid App Store Icon. The App Store Icon in the asset catalog in 'YourApp.app' can't be transparent nor contain an alpha channel."
I made sure that I submitted a file with no transparency. So the error persisted in submission to iTunes Connect.
The below solution worked for me
Click & open the App Store icon (1024*1024) in the preview app.
Export it by unticking the Alpha channel.
Replace the current App Store icon with the newly exported icon image.
Validate and upload.
Note: This will not work on Mac OS High Sierra, please try a lower version to export without alpha or use any one of the image editing applications or try out the below alternatives.
Alternative 1: (Using Sierra or High Sierra and Ionic)
Copy and Paste the App Store icon to the desktop.
Open the image. Click File Menu->Duplicate.
Save it by unticking the Alpha channel.
Replace the current App Store icon with this one.
Validate and upload.
Alternative 2: If duplicate does not work, try doing opening it in preview and then doing file export. I was able to unselect the alpha channel there. – #AlejandroCorredor.
Alternative 3 : Using High Sierra and Ionic, found the problem image in the following folder: [app name]/platforms/ios/[app name]/Images.xcassets/Appicon.appiconset/icon-1024.png. We have to copy it to the desktop and Save As while unchecking Alpha, then rename it to icon-1024.png, then delete the original and copy the new file back to the original folder. Export did not work though no error was displayed and all permissions were set/777. – #RalphHinkley
I faced the same problem and wasn't able to fix it with the provided solution by Shamsudheen TK. Ionic somehow added transparency to my icons even if the source icon did not have any transparency at all. In the end I was able to resolve it by:
Install imagemagick (MacOS):
brew install imagemagick
Remove alpha channel from all images in resource folder:
find ./resources/ -name "*.png" -exec convert "{}" -alpha off "{}" \;
Here is a solution that have worked for me on High Sierra
Open the App Store icon (1024*1024) in Preview app(default OSX image viewer).
Click on the File menu from the menu bar and select Export.
view screenshot
Uncheck Alpha, select where you would like to export the image and click on the Save button. view screenshot
Replace the current App Store icon with the newly exported icon image.
Validate and upload.
For anyone arriving to this question from Flutter, like myself:
In your pubspec.yaml:
flutter_icons:
android: false. // I already had android icons
ios: true
remove_alpha_ios: true
image_path: 'assets/images/icon.png' // Your image path
Run flutter pub get
Run flutter pub run flutter_launcher_icons:main to generate the iOS icons without alpha.
This fixed it for me after days of struggling. And yes, I did try all the solutions suggested here. Nothing else worked.
If you are here and you are using Flutter, try this package https://pub.dev/packages/flutter_launcher_icons
Then add
flutter_launcher_icons:
flutter_icons:
android: true
ios: true
remove_alpha_ios: true
image_path: "assets/images/logo.png"
to your pubspec.yaml file
It solved my own problem for me
Whatever way you try above you need to test it by upload it to app connect like me to make sure it works and save your valuable time
If showing this error for ionic3 project when you upload to iTunes Connect, please check this ANSWER
This is my project error when I try to vilidated.
Finally follow this ANSWER, error solved.
Dumb mistake from my part, didn't archive the app after removing alpha. Just kept submitting my old archived app and finding same alpha/transparency error. Hope it helps someone.
Invalid App Store Icon. The App Store Icon in the asset catalog in 'YourApp.app' can't be transparent nor contain an alpha channel.
Solved in Catalina
copy to desktop
open image in PREVIEW APP.
File -> Duplicate Close the first opened preview
after try to close the second duplicated image, then it will prompt to save there you will available to untick AlPHA
look into my screenshot
An error message itself says:
"Invalid App Store Icon. The App Store Icon in the asset catalog in
'YourApp.app' can't be transparent nor contain an alpha channel."
All app icon must be square without transparency or semi transparent (alpha value != 1.0).
Hint: App icon may have rounded corners. (Share your app icons here)
Here is Apple guidelines for App Icon - Human Interface
If you’re using Sierra or later
Navigate to AppIcon.appiconset folder within your Runner folder
Open App Icon image using preview.
At the topmost left of your screen select File its beside edit.
Within the file drop down select export.
Deselect alpha list item.
Replace the deselected alpha image with old one.
Replicate this for all App Icon images in your Assets.xcassets
Generate App icon from here https://appicon.co/
Delete Assets.xcassets file (project->ios->runner)
Copy Assets.xcassets from newly generated icons folder and past here (project->ios->runner)
perform clean build folder from XCode
then archive and upload new build
I tried several of the things mentioned in this post (besides swapping to a .jpg) with no success. I solved it by opening the file in photoshop and using 'export to web'. Within that process/window is a checkbox for transparency.
If you don't have a mac, on windows you can open Paint and save as PNG with correct dimensions 1024x1024
Remove the alpha channel using this command in the folder 'Images.xcassets', this command will remove all alpha channels from your .png files and it will put the background color to white
for i in `ls *.png`; do convert $i -background white -alpha remove -alpha off $i; done
If you're facing this issue in Flutter then you're good to go here.
Issue is indicating you're using .png as image asset. Just try to replace .png to .jpg and build your project again..!!
Use this plugin. - flutter_launcher_icons: ^0.8.1
flutter_icons:
android: "ic_launcher"
image_path_android: "assets/logo_panda.jpg"
ios: true
image_path_ios: "assets/logo_panda.jpg"
Make sure you're using the .jpg image extension as the image path.
This help me to upload the app to the App Store.
Use Alpha Channel Remover. It lets you drag icons into the app and it'll remove transparency.
Download it from here: http://alphachannelremover.blogspot.com
Update: this is not my site
I had this problem and it was because my app store icon wasn't explicitly listed in my config.xml. Once I added the line
<icon height="1024" src="www/res/icon/ios/icon-1024.png" width="1024" />,
cordova copied it over correctly without adding an alpha channel.
I was able to get around the Mac Sierra OS issue by duplicating the file, dragging the new file onto my desktop, open in preview, then click the export option (in the File menu) , then the option to save it without “alpha” comes up
I also shell script using ffmpeg to resize images without alphachannel. It worked for png format fine.
# Export ios app icons by ffmpeg scale command
# usage: sh export_ios_icons.sh {path_to_your_img}
# example: sh export_ios_icons.sh ./app_icon.png
# sizes of images
# you can get other size images by editing thisarray
size=(20 40 60 29 58 87 80 120 180 76 152 167 1024)
for i in "${size[#]}"
do
:
ffmpeg -i $1 -vf scale=$i:$i output_$ix$i.png
done
Alternative:(Using Sierra or High Sierra and Ionic)
Copy and Paste the App Store icon to the desktop.
Open the image. Click File Menu->Duplicate.
Save it by unticking the Alpha channel.
Replace the current App Store icon with this one.
Validate and upload.
I also tried exporting without alpha it did not work for me but I figured it out that why I was getting error. I create an AppIcon using Figma & Sketch, but I tried to make a 2D geometry shape to 3D viewable. So I assume that I can achieve it by using some shadows & the same geometry but with lower alpha-like %70. After that, I got the AppIcon and export it without Alpha ticking but the problem was the main source of the image includes a container with lower alpha-like I did. So I change it to another graphical shape without alpha and it worked.
I am using Windows so in my case I used paint.net.
Open the icon in question and click Ctrl+S
A Save configuration dialog will pop out.
Select 24-bit Depth
After this icons got accepted.
P.S
Another option colleague suggested was to simply open with ms paint and save it, since paint does not support transparency, but I haven't tested it.
changed the icon from .png format to .jpg and everything went well.

Using PDFs for icon images in Xcode 7.2

I'm attempting to use PDF files as icons in an app I'm working on. The issue I'm encountering is I'm getting inconsistent tint colors.
If I set a button image from interface builder, the icon image shows up black at runtime. Every time. Regardless of what I attempt to set from interface builder.
I tried setting my button icon image via code and instead of showing up black, it's white:
let myGraphicFile = UIImage(named: "myPDFImage")
let myButtonImage = myGraphicFile?.imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate)
myButton.setImage(myButtonImage, forState: .Normal)
From code, regardless of what I attempt to set the tint to, it's always white from code.
I discovered this post relating to Xcode 6.x, but I think it might be dated, as I'm able to partially do it, but I can't set the tint.
Use PDF in XCode for an AppIcon (.appiconset collection)
I create the icons in Inkscape, save as PDF 1.5. I add the file to Images.xcassets. In Images.xcassets' attributes inspector, I'm setting:
Devices to Universal
Scale factor to Single Vector.
Summary: I can get it to show up and scale properly, but it's either black from interface builder or white from code. I suspect I'm missing something re: how to save the file from Inkscape.
Thank you for reading. If you have any suggestions, I welcome them.
I have figured out how to create vector icons with Inkscape. When you use PDFs to display icons in iOS, you need to alter the Attributes Inspector for your icon in xcAssets as follows:
1) Drag the PDF into xcAssets
2) Set devices (I did Universal and it worked fine)
3) If your PDF icon is under 1x, 2x, or 3x size class, drag it to Universal and delete the rest of them.
4) Set Scale Factors to Single Vector.
5) Render as Template Image.
Once it's configured there, then you just treat it was you would any other image in interface builder. It's essentially the same thing I was doing in code, but I don't think it gets done in code...it's gotta be done on xcAssets where the image lives. It's my understanding iOS renders vector images for the size class at run time. I think by attempting to tweak it in code wasn't working because the image had already been rendered.
If anyone has any questions on this, I found this link helpful in resolving my issue.
Additionally, this post covers the topic, too. https://stackoverflow.com/a/25804358/4475605

ios - UITabBar images are not rendering on the emulator

I have an image that looks like this:
I am trying to make it render on the UITabBar and here is what I did. I went in XCode to File --> Add Files to Project, then I chose the files I wanted and they got added.
Then when I clicked on the files, on the right side of the screen, under "target membership" the checkbox was checked.
But when I added the file name to the UITabBar item, the emulator showed a blank rectangle instead of just empty space...so it recognized the image...but it didn't render that image.
Would someone happen to know what I did wrong? Are the dimensions of the image supposed to be rectangle or square? I have 48x48 square png file.
Can you check your image info?
These are the guidelines for UITabBar image:
30x30 (48x32)
PNG
Anti-aliased
Transparency set
Custom Icon and Image Creation Guidelines

Resources