1

Why my images not showing off ?

Label is displaying url properly but image not show. Why its not displaying? need to add something ? It was working before. If I added normal Image with src plain text like this its showed

 <StackLayout> <Button text="Make new screensot" /> <Button text="Load images" @tap="loadImages()" /> <Label v-if="!loadedImages" text="Not loaded images" textWrap="true" /> <RadListView v-else for="(item,index) in imagesS" itemHeight="100"> <v-template> <StackLayout orientation="vertical"> <Label :text="item.url"></Label> <Image :src="item.url" stretch="aspectFill" class="screenshots" /> </StackLayout> </v-template> </RadListView> <ActivityIndicator class="activity-indicator" :busy="indicatorS"></ActivityIndicator> </StackLayout> 

I added css but not working too

 .screenshots{ height:100; width:100; } 

methods

methods: { loadImages() { console.log('starting loading images'); this.indicatorS = true; axios.get(this.jsonUsers + this.ID + '/images') .then((response) => { const imgCount = response.data.length; console.log("count- " + imgCount) var imagesArr = response.data; console.dir("images - " + response.data[0].url) this.$store.commit('setImages',imagesArr); console.log('images fully loaded'); this.$store.commit('setLoadedImages'); this.indicatorS = false; }) } } 

app

1

1 Answer 1

2

I tried this in the playground. https://play.nativescript.org/?template=play-vue&id=aKZ2wm.

I think the URLs you are using are not really for the images.https://imgur.com/a/AkEg8vy This is what you are using, that is not a url for the image its a URL for a web page.

Now if I go to the page and take the image URL https://i.imgur.com/78j1SJr.jpg. It's working fine.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.