ImageCell not displaying image loaded from a URICreating a byte array from a streamHow do I update the GUI from another thread?MetadataException: Unable to load the specified metadata resourceGet int value from enum in C#Get property value from string using reflection in C#How do I remedy the “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning?Call one constructor from anotherWhy not inherit from List<T>?How to load an image to a ImageCell on Xamarin.Forms?C# & XAML - Display JSON in ListView from Wunderground API
Fermat's statement about the ancients: How serious was he?
Is it expected that a reader will skip parts of what you write?
What are some really overused phrases in French that are common nowadays?
Why am I getting a strange double quote (“) in Open Office instead of the ordinary one (")?
Electricity free spaceship
bash does not know the letter 'p'
How can one's career as a reviewer be ended?
What is the logic behind taxing money for property?
Bb13b9 confusion
How do free-speech protections in the United States apply in public to corporate misrepresentations?
Can the removal of a duty-free sales trolley result in a measurable reduction in emissions?
Which is the better way to call a method that is only available to one class that implements an interface but not the other one?
Why was this person allowed to become Grand Maester?
Are inverted question and exclamation mark supposed to be symmetrical to the "normal" counter-parts?
Did Apple bundle a specific monitor with the Apple II+ for schools?
A map of non-pathological topology?
Which languages would be most useful in Europe at the end of the 19th century?
Can a human be transformed into a Mind Flayer?
Russian word for a male zebra
Are polynomials with the same roots identical?
Longest bridge/tunnel that can be cycled over/through?
How can I make 12 tone and atonal melodies sound interesting?
Should I put programming books I wrote a few years ago on my resume?
What is the purpose of bonds within an investment portfolio?
ImageCell not displaying image loaded from a URI
Creating a byte array from a streamHow do I update the GUI from another thread?MetadataException: Unable to load the specified metadata resourceGet int value from enum in C#Get property value from string using reflection in C#How do I remedy the “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning?Call one constructor from anotherWhy not inherit from List<T>?How to load an image to a ImageCell on Xamarin.Forms?C# & XAML - Display JSON in ListView from Wunderground API
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am coding an app that pulls JSON data from FLickr and displays an list of image cells. The app gives no errors and allows a search to be entered and pulls the data. The title data displays without issue but the image remains blank. I learned Xamarin years ago in college before all the updates and I am having trouble sorting out this issue. I can't seem to find information on how to fix this problem.
<SearchBar x:Name="Searchbar" Placeholder="Search" TextChanged="
<ScrollView>
<ListView x:Name="listView">
<ListView.ItemTemplate>
<DataTemplate>
<ImageCell Height="50"
Text="Binding title"
ImageSource="Binding url"
Tapped="ImageCell_Tapped">
</ImageCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollView>
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using System.Collections.ObjectModel;
using Android.Graphics;
namespace InvestCloudChallenge
public partial class MainPage : ContentPage
string searchText;
HttpClient myClient = new HttpClient();
string APIKey = "api-key here";
string url = "https://api.flickr.com/services/rest/?
method=flickr.photos.search" +
"&api_key=0" +
"&text=1" +
"&format=json&nojsoncallback=1";
string photoUrl = "http://farm0.staticflikr.com/1/2_3_n.jpg";
IList<Photo> imageList = new ObservableCollection<Photo>();
public MainPage()
InitializeComponent();
private async void updateList()
imageList.Clear();
var completeUrl = string.Format(url,APIKey,searchText);
var results = await myClient.GetStringAsync(completeUrl);
PhotoData apidata = JsonConvert.DeserializeObject<PhotoData>
(results);
if (apidata.stat == "ok")
foreach (Photo data in apidata.photos.photo)
Photo myPhoto = new Photo()
title = data.title,
url = new Uri(string.Format(photoUrl, data.farm,
data.server, data.id, data.secret)),
;
imageList.Add(myPhoto);
listView.ItemsSource = imageList;
private void OnTextChanged(object sender,TextChangedEventArgs
eventArgs)
if (Searchbar?.Text != "")
searchText = Searchbar.Text.ToString();
updateList();
public class Photo
public string id get; set;
public string owner get; set;
public string secret get; set;
public string server get; set;
public int farm get; set;
public string title get; set;
public int ispublic get; set;
public int isfriend get; set;
public int isfamily get; set;
public Uri url get; set;
public class Photos
public int page get; set;
public int pages get; set;
public int perpage get; set;
public string total get; set;
public List<Photo> photo get; set;
public class PhotoData
public Photos photos get; set;
public string stat get; set;
c# xamarin
add a comment |
I am coding an app that pulls JSON data from FLickr and displays an list of image cells. The app gives no errors and allows a search to be entered and pulls the data. The title data displays without issue but the image remains blank. I learned Xamarin years ago in college before all the updates and I am having trouble sorting out this issue. I can't seem to find information on how to fix this problem.
<SearchBar x:Name="Searchbar" Placeholder="Search" TextChanged="
<ScrollView>
<ListView x:Name="listView">
<ListView.ItemTemplate>
<DataTemplate>
<ImageCell Height="50"
Text="Binding title"
ImageSource="Binding url"
Tapped="ImageCell_Tapped">
</ImageCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollView>
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using System.Collections.ObjectModel;
using Android.Graphics;
namespace InvestCloudChallenge
public partial class MainPage : ContentPage
string searchText;
HttpClient myClient = new HttpClient();
string APIKey = "api-key here";
string url = "https://api.flickr.com/services/rest/?
method=flickr.photos.search" +
"&api_key=0" +
"&text=1" +
"&format=json&nojsoncallback=1";
string photoUrl = "http://farm0.staticflikr.com/1/2_3_n.jpg";
IList<Photo> imageList = new ObservableCollection<Photo>();
public MainPage()
InitializeComponent();
private async void updateList()
imageList.Clear();
var completeUrl = string.Format(url,APIKey,searchText);
var results = await myClient.GetStringAsync(completeUrl);
PhotoData apidata = JsonConvert.DeserializeObject<PhotoData>
(results);
if (apidata.stat == "ok")
foreach (Photo data in apidata.photos.photo)
Photo myPhoto = new Photo()
title = data.title,
url = new Uri(string.Format(photoUrl, data.farm,
data.server, data.id, data.secret)),
;
imageList.Add(myPhoto);
listView.ItemsSource = imageList;
private void OnTextChanged(object sender,TextChangedEventArgs
eventArgs)
if (Searchbar?.Text != "")
searchText = Searchbar.Text.ToString();
updateList();
public class Photo
public string id get; set;
public string owner get; set;
public string secret get; set;
public string server get; set;
public int farm get; set;
public string title get; set;
public int ispublic get; set;
public int isfriend get; set;
public int isfamily get; set;
public Uri url get; set;
public class Photos
public int page get; set;
public int pages get; set;
public int perpage get; set;
public string total get; set;
public List<Photo> photo get; set;
public class PhotoData
public Photos photos get; set;
public string stat get; set;
c# xamarin
1
have you checked the application output to see if it is displaying any relevant messages? Have you verified that the urls you're building are valid and work in the device/emulator browser?
– Jason
Mar 24 at 20:04
Initially i didn't see anything in the output but I did some digging and found this message repeatedly. [0:] ImageLoaderSourceHandler: Could not retrieve image or image data was invalid: Uri: farm8.staticflikr.com/7899/33582703938_1e830f040f_n.jpg I checked the link in the browser of the device and it pulls up the image correctly.
– Chris Jacobson
Mar 24 at 20:47
that url doesn't load for me. Is it a private image? Do you have to set any headers or authentication to retrieve it?
– Jason
Mar 24 at 20:51
It doesn't work in my computer browser either it will only load when i try it in the device browser. I am not sure why.
– Chris Jacobson
Mar 24 at 20:56
staticfliCkr.com - you left out thee second "C"
– Jason
Mar 24 at 22:12
add a comment |
I am coding an app that pulls JSON data from FLickr and displays an list of image cells. The app gives no errors and allows a search to be entered and pulls the data. The title data displays without issue but the image remains blank. I learned Xamarin years ago in college before all the updates and I am having trouble sorting out this issue. I can't seem to find information on how to fix this problem.
<SearchBar x:Name="Searchbar" Placeholder="Search" TextChanged="
<ScrollView>
<ListView x:Name="listView">
<ListView.ItemTemplate>
<DataTemplate>
<ImageCell Height="50"
Text="Binding title"
ImageSource="Binding url"
Tapped="ImageCell_Tapped">
</ImageCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollView>
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using System.Collections.ObjectModel;
using Android.Graphics;
namespace InvestCloudChallenge
public partial class MainPage : ContentPage
string searchText;
HttpClient myClient = new HttpClient();
string APIKey = "api-key here";
string url = "https://api.flickr.com/services/rest/?
method=flickr.photos.search" +
"&api_key=0" +
"&text=1" +
"&format=json&nojsoncallback=1";
string photoUrl = "http://farm0.staticflikr.com/1/2_3_n.jpg";
IList<Photo> imageList = new ObservableCollection<Photo>();
public MainPage()
InitializeComponent();
private async void updateList()
imageList.Clear();
var completeUrl = string.Format(url,APIKey,searchText);
var results = await myClient.GetStringAsync(completeUrl);
PhotoData apidata = JsonConvert.DeserializeObject<PhotoData>
(results);
if (apidata.stat == "ok")
foreach (Photo data in apidata.photos.photo)
Photo myPhoto = new Photo()
title = data.title,
url = new Uri(string.Format(photoUrl, data.farm,
data.server, data.id, data.secret)),
;
imageList.Add(myPhoto);
listView.ItemsSource = imageList;
private void OnTextChanged(object sender,TextChangedEventArgs
eventArgs)
if (Searchbar?.Text != "")
searchText = Searchbar.Text.ToString();
updateList();
public class Photo
public string id get; set;
public string owner get; set;
public string secret get; set;
public string server get; set;
public int farm get; set;
public string title get; set;
public int ispublic get; set;
public int isfriend get; set;
public int isfamily get; set;
public Uri url get; set;
public class Photos
public int page get; set;
public int pages get; set;
public int perpage get; set;
public string total get; set;
public List<Photo> photo get; set;
public class PhotoData
public Photos photos get; set;
public string stat get; set;
c# xamarin
I am coding an app that pulls JSON data from FLickr and displays an list of image cells. The app gives no errors and allows a search to be entered and pulls the data. The title data displays without issue but the image remains blank. I learned Xamarin years ago in college before all the updates and I am having trouble sorting out this issue. I can't seem to find information on how to fix this problem.
<SearchBar x:Name="Searchbar" Placeholder="Search" TextChanged="
<ScrollView>
<ListView x:Name="listView">
<ListView.ItemTemplate>
<DataTemplate>
<ImageCell Height="50"
Text="Binding title"
ImageSource="Binding url"
Tapped="ImageCell_Tapped">
</ImageCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ScrollView>
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using System.Collections.ObjectModel;
using Android.Graphics;
namespace InvestCloudChallenge
public partial class MainPage : ContentPage
string searchText;
HttpClient myClient = new HttpClient();
string APIKey = "api-key here";
string url = "https://api.flickr.com/services/rest/?
method=flickr.photos.search" +
"&api_key=0" +
"&text=1" +
"&format=json&nojsoncallback=1";
string photoUrl = "http://farm0.staticflikr.com/1/2_3_n.jpg";
IList<Photo> imageList = new ObservableCollection<Photo>();
public MainPage()
InitializeComponent();
private async void updateList()
imageList.Clear();
var completeUrl = string.Format(url,APIKey,searchText);
var results = await myClient.GetStringAsync(completeUrl);
PhotoData apidata = JsonConvert.DeserializeObject<PhotoData>
(results);
if (apidata.stat == "ok")
foreach (Photo data in apidata.photos.photo)
Photo myPhoto = new Photo()
title = data.title,
url = new Uri(string.Format(photoUrl, data.farm,
data.server, data.id, data.secret)),
;
imageList.Add(myPhoto);
listView.ItemsSource = imageList;
private void OnTextChanged(object sender,TextChangedEventArgs
eventArgs)
if (Searchbar?.Text != "")
searchText = Searchbar.Text.ToString();
updateList();
public class Photo
public string id get; set;
public string owner get; set;
public string secret get; set;
public string server get; set;
public int farm get; set;
public string title get; set;
public int ispublic get; set;
public int isfriend get; set;
public int isfamily get; set;
public Uri url get; set;
public class Photos
public int page get; set;
public int pages get; set;
public int perpage get; set;
public string total get; set;
public List<Photo> photo get; set;
public class PhotoData
public Photos photos get; set;
public string stat get; set;
c# xamarin
c# xamarin
edited Mar 24 at 20:55
Chris Jacobson
asked Mar 24 at 19:58
Chris JacobsonChris Jacobson
33
33
1
have you checked the application output to see if it is displaying any relevant messages? Have you verified that the urls you're building are valid and work in the device/emulator browser?
– Jason
Mar 24 at 20:04
Initially i didn't see anything in the output but I did some digging and found this message repeatedly. [0:] ImageLoaderSourceHandler: Could not retrieve image or image data was invalid: Uri: farm8.staticflikr.com/7899/33582703938_1e830f040f_n.jpg I checked the link in the browser of the device and it pulls up the image correctly.
– Chris Jacobson
Mar 24 at 20:47
that url doesn't load for me. Is it a private image? Do you have to set any headers or authentication to retrieve it?
– Jason
Mar 24 at 20:51
It doesn't work in my computer browser either it will only load when i try it in the device browser. I am not sure why.
– Chris Jacobson
Mar 24 at 20:56
staticfliCkr.com - you left out thee second "C"
– Jason
Mar 24 at 22:12
add a comment |
1
have you checked the application output to see if it is displaying any relevant messages? Have you verified that the urls you're building are valid and work in the device/emulator browser?
– Jason
Mar 24 at 20:04
Initially i didn't see anything in the output but I did some digging and found this message repeatedly. [0:] ImageLoaderSourceHandler: Could not retrieve image or image data was invalid: Uri: farm8.staticflikr.com/7899/33582703938_1e830f040f_n.jpg I checked the link in the browser of the device and it pulls up the image correctly.
– Chris Jacobson
Mar 24 at 20:47
that url doesn't load for me. Is it a private image? Do you have to set any headers or authentication to retrieve it?
– Jason
Mar 24 at 20:51
It doesn't work in my computer browser either it will only load when i try it in the device browser. I am not sure why.
– Chris Jacobson
Mar 24 at 20:56
staticfliCkr.com - you left out thee second "C"
– Jason
Mar 24 at 22:12
1
1
have you checked the application output to see if it is displaying any relevant messages? Have you verified that the urls you're building are valid and work in the device/emulator browser?
– Jason
Mar 24 at 20:04
have you checked the application output to see if it is displaying any relevant messages? Have you verified that the urls you're building are valid and work in the device/emulator browser?
– Jason
Mar 24 at 20:04
Initially i didn't see anything in the output but I did some digging and found this message repeatedly. [0:] ImageLoaderSourceHandler: Could not retrieve image or image data was invalid: Uri: farm8.staticflikr.com/7899/33582703938_1e830f040f_n.jpg I checked the link in the browser of the device and it pulls up the image correctly.
– Chris Jacobson
Mar 24 at 20:47
Initially i didn't see anything in the output but I did some digging and found this message repeatedly. [0:] ImageLoaderSourceHandler: Could not retrieve image or image data was invalid: Uri: farm8.staticflikr.com/7899/33582703938_1e830f040f_n.jpg I checked the link in the browser of the device and it pulls up the image correctly.
– Chris Jacobson
Mar 24 at 20:47
that url doesn't load for me. Is it a private image? Do you have to set any headers or authentication to retrieve it?
– Jason
Mar 24 at 20:51
that url doesn't load for me. Is it a private image? Do you have to set any headers or authentication to retrieve it?
– Jason
Mar 24 at 20:51
It doesn't work in my computer browser either it will only load when i try it in the device browser. I am not sure why.
– Chris Jacobson
Mar 24 at 20:56
It doesn't work in my computer browser either it will only load when i try it in the device browser. I am not sure why.
– Chris Jacobson
Mar 24 at 20:56
staticfliCkr.com - you left out thee second "C"
– Jason
Mar 24 at 22:12
staticfliCkr.com - you left out thee second "C"
– Jason
Mar 24 at 22:12
add a comment |
1 Answer
1
active
oldest
votes
Flickr is misspelt in the url
string photoUrl = "http://farm0.staticflikr.com/1/2_3_n.jpg";
should be
string photoUrl = "http://farm0.staticflickr.com/1/2_3_n.jpg";
*facepalm.... ugh it's always the tiny typo that causes an issue. Thank you so much for your help!
– Chris Jacobson
Mar 24 at 22:44
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55327994%2fimagecell-not-displaying-image-loaded-from-a-uri%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Flickr is misspelt in the url
string photoUrl = "http://farm0.staticflikr.com/1/2_3_n.jpg";
should be
string photoUrl = "http://farm0.staticflickr.com/1/2_3_n.jpg";
*facepalm.... ugh it's always the tiny typo that causes an issue. Thank you so much for your help!
– Chris Jacobson
Mar 24 at 22:44
add a comment |
Flickr is misspelt in the url
string photoUrl = "http://farm0.staticflikr.com/1/2_3_n.jpg";
should be
string photoUrl = "http://farm0.staticflickr.com/1/2_3_n.jpg";
*facepalm.... ugh it's always the tiny typo that causes an issue. Thank you so much for your help!
– Chris Jacobson
Mar 24 at 22:44
add a comment |
Flickr is misspelt in the url
string photoUrl = "http://farm0.staticflikr.com/1/2_3_n.jpg";
should be
string photoUrl = "http://farm0.staticflickr.com/1/2_3_n.jpg";
Flickr is misspelt in the url
string photoUrl = "http://farm0.staticflikr.com/1/2_3_n.jpg";
should be
string photoUrl = "http://farm0.staticflickr.com/1/2_3_n.jpg";
answered Mar 24 at 22:13
JasonJason
54.3k1396121
54.3k1396121
*facepalm.... ugh it's always the tiny typo that causes an issue. Thank you so much for your help!
– Chris Jacobson
Mar 24 at 22:44
add a comment |
*facepalm.... ugh it's always the tiny typo that causes an issue. Thank you so much for your help!
– Chris Jacobson
Mar 24 at 22:44
*facepalm.... ugh it's always the tiny typo that causes an issue. Thank you so much for your help!
– Chris Jacobson
Mar 24 at 22:44
*facepalm.... ugh it's always the tiny typo that causes an issue. Thank you so much for your help!
– Chris Jacobson
Mar 24 at 22:44
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55327994%2fimagecell-not-displaying-image-loaded-from-a-uri%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
have you checked the application output to see if it is displaying any relevant messages? Have you verified that the urls you're building are valid and work in the device/emulator browser?
– Jason
Mar 24 at 20:04
Initially i didn't see anything in the output but I did some digging and found this message repeatedly. [0:] ImageLoaderSourceHandler: Could not retrieve image or image data was invalid: Uri: farm8.staticflikr.com/7899/33582703938_1e830f040f_n.jpg I checked the link in the browser of the device and it pulls up the image correctly.
– Chris Jacobson
Mar 24 at 20:47
that url doesn't load for me. Is it a private image? Do you have to set any headers or authentication to retrieve it?
– Jason
Mar 24 at 20:51
It doesn't work in my computer browser either it will only load when i try it in the device browser. I am not sure why.
– Chris Jacobson
Mar 24 at 20:56
staticfliCkr.com - you left out thee second "C"
– Jason
Mar 24 at 22:12