From the course: Android Development Essential Training: 2 User Interface Design

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Display image resources

Display image resources - Android Tutorial

From the course: Android Development Essential Training: 2 User Interface Design

Start my 1-month free trial

Display image resources

- [Instructor] In Android, one way to display an image is by using the image view component. Let's add one to our empty layout file and explore some of its properties. We'll drag it over from the pallet, and then we'll just place it here inside of our parent constraint layout. When we drag it over, we're presented with a dialogue that allows us to pick the image that we want displayed inside of our image view. We're going to choose the avatar image that's part of the sample data. This is useful for helping us to position our view, but when we run the app, it's not actually displayed to users. Let's click on okay, and now we see our avatar displayed inside the image view. When we open up the attributes pane, notice how under srcCompat field it's actually referenced as an array. You can randomly provide another value to this array index in order to try out additional placeholders. For example, I'm going to change the…

Contents