[su_youtube_advanced url=”https://youtu.be/oqk3RUgEYnI”]
What exactly is a view in android ?
A view is a rectangle on the screen that shows some content. It can be an image, a piece of text, a button or anything else which app can display.
These individual views make up what we called layout of the screen.
Everything that you see on screen and interact with in your app is called user interface or UI
There are different type of views with different names
- TextView
- ImageView
- Button
TextView:
A view that shows text is Textview.
Imageview
A view that shows an image is called Image view
Button
A view that shows a button is called button view
There are many other types of view in android which are really helpful to use which can be found here.
Earlier we mentioned, Every view is a rectangle on the screen but where are the rectangles?
Well, technically they are invisible but they are there.
let’s take a look at below to see the bounds of the rectangle.
As you can see, every app can be broken down into an individual view set that makes it up.
View is a basic building block that you use to build up a layout of your app.
For example you can take a look at ms word or paint or Photoshop.
If you ever use one of these then you may have added a textbox to the canvas.
Then you type in the text and click outside the box you don’t see the bounds of the rectangle but they are there, Bounds can be seen if you start adding color in it by adding background color or add border around it which highlights the rectangle then it does matter how big the rectangle is.
The format of this view name is in CamelCase.
CamelCase : camelcase means there is no space between words and the beginning of each word is capitalized. The outline of words goes up and down like humps of camel back
Believe it or not, professional developers don’t memorize everything
No comments:
Post a Comment