In my Xamarin.Forms app, I have copied some files into my device and those files don't have an extension. Actually those are image files. now I want to show those images in my UI. For that I am doing like this in my shared project.
string path = DependencyService.Get<IFileManager>().GetLocalFilePath(attachmentName);
image.Source = ImageSource.FromFile(path);
Both in UWP and Android these images are showing perfectly but in iOS. This is the path that I am getting for iOS.
"/var/mobile/Containers/Data/Application/74FC64B4-3B37-4240-966B-2DB1CAFF0E45/Documents/Library/Databases/5302"
5302 is my file name and it has no extension. In iOS I cannot see any image. Please help me.
Thanks.
Put all your images in the Resources-folder of your iOS-project and it should work!
Related
I have a project for Android and iOS that needs to show a user image and video in a view.
In Android this was simple. I could just get the path using
System.IO.Path.Combine(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath, Android.OS.Environment.DirectoryPictures);
And then I used System.IO to check file existence and finally, show that in the view (shared project).
What should be the equivalent in iOS?
When I plug the target iPhone in a USB port and browse its files, I only see one folder called DCIM which contains some folders with pictures.
Can I use that folder? how can I access it from the iOS project?
I tried with:
System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonPictures);
But it returns an empty string.
Any help, please?
Thanks
Jaime
In image asset editor we can add launch image but it'll not appear in devices I can say atleast iPhone devices but If you ignore to add LaunchImage in assets xamarin won't let you compile the app.so you have to add the LaunchImage and at the same time you have to have Launch Screen.storyboard Why is this anomaly ? and how to keep on using static images
I have created separate imageset in asset library and added a image view in launch screen and referred that newly added imageset but its not working screen appears empty
It's not a Xamarin problem, but iOS itself.
Launch image required for iOS version lower than 8.0. So if you want to support them, you need to add all images in to assets.
LaunchStoryboard you can use for all iOS version above 8.0 (included). It will stretch out automatically for each device.
You can select most appropriate solution for your project in Info.plist
I'm using Local Notifications Plugin for Xamarin, in a Xamarin Forms app.
(https://github.com/edsnider/LocalNotificationsPlugin)
I got it working, but I have a question about the logo beside the notification.
I doesn't understand the readme on GitHub.
Does anyone know how to change it?
(Both on Android and iOS).
Android Image
(I'm not allowed to post more than 2 links that's why I can't send pic on iOS)
Thanks!
Add the icon you want to use to your Android project (under the Resources folder). Make sure the Build Action is set to AndroidResource, this should be done automatically.
Then somewhere in your Android project, probably the MainActivity is a good place, add this line: LocalNotificationsImplementation.NotificationIconId = Resource.Drawable.YOUR_ICON_HERE.
Of course at the place of the YOUR_ICON_HERE you should enter the identifier of your icon, which is probably the filename without its extension of the file you added.
The Following are the steps to follow to change the icon in a flutter local Notification.
Resize the image you want to put to 72 x 72
Transfer the image into the Android-app-src-main-res- drawable folder.
Change the default icon of the Application in the AndroidManifest file to that you put in the drawable folder
Rerun the application and test the Flutter Local Notification and see if the changes appear.
Here are the results
When I build my titanium app in appcelerator, the app icon is missing from the organiser when I build it for app store submission
How can I resolve this thanks
Edit:
In itunes connect, this is how it appears after I select the build:
Icon is missing.
Yes we need to have the iTunesArtwork(512X512) and iTunesArtwork#2x(1024X1024) in the folder Resource->iphone-> here we need to have that 2 files.
I've met the same problem recently. I don't know the real reason behind that, but I find that if I change the extension of the image file directly from jpg to png, the AppIcon will not show in the organizer. However, if I open the image with the preview application, export png version of the image and add it to Xcode, the AppIcon will show in the organizer.
Hope this will be helpful for you.
Do you have the iTunesArtwork and iTunesArtwork#2x images in the root of your Titanium project? They are simply png images without the extension. They go in the same folder as the tiapp.xml.
Check alpha channel for all app icons. If alpha channel is exist then just remove alpha channel and then try it.
Thanks
For iOS Only
If you are using Ti SDK >= 5.0.0 GA you must make an Icon called DefaultIcon.png and Ti will make all icons you want automatically !.
You are recommended to add a 1024 x 1024 PNG image, named DefaultIcon.png placed in the project's root folder, which is used to generate all or only omitted icons for the project. New Titanium projects will have the DefaultIcon.png file.
Reference https://docs.appcelerator.com/platform/release-notes/?version=5.0.0.GA
For iOS and Android http://ticons.fokkezb.nl/ it`s awesome tool from https://stackoverflow.com/users/4626813/fokke-zandbergen
I would like to update some images (gif) in my application. After replacing the gif files in the folder, I build the application and run it; the images shown in simulator are not updated. I tried to "Clear all target" and then re-built the application; the new images can be shown in the simulator.
Does it mean the images will be successfully updated in the devices which have installed the older version of the application? Should I modify the code?
You would need to "Replace" those image by the same names as in the earlier build.In this way even if your app is in the App Store, after submitting your update with the new images having the same names can be updated easily.
No need to modify your code.