How to use Absolute & Table Layout in Android Studio

  

Source: Edureka


Absolute Layout

Welcome, Today We will see, How to write a program to place name, age, mobile number in linear Layout, on the screen and display using linear layout. We will display it as a vertical one, so here. you can see We have our empty activity and We have linear layout. Now what we'll do, We will just in text view. We will place a text here. Now you can see that it is coming here. 

Code

The code part of what We will do is just create an android orientation as vertical. Now you can see here. We have a vertical and now We will add one more to let him make it. Let's lift out and then press one more and press one so you can see. We have our three linear layouts and they are all vertical. So what you will do, We will just add editor text here. And just write your name in the TextView you can see here. We will just add return ages suppose 18 and then mobile number is like 9876543211. 

Testing

Now you can see this is how We can place it. So let's first run our program and launch our app. Now you can see We have three layers here, now what We will do, We will just modify some of the text. So here. you can see there. is an option called text size.

 So I'm just testing like 50 SP and so if We want to take it. As a centre you know so. What you can do, gravity as centre. So Let's see if it works. Let me just program and let's see so now you can see. This is launching our app.

Output :

 


Table Layout


We will see, How to write your program to display student basic information in table form using table layout. So that's what We are doing here. We will just create a new project here. and then what We will do, We will create an empty activity We will give it name as let's say experiment 6 and We keep its language and version here.


Finish, when you click the finish. It will create an application environment for us here. We have our code part here. We have our design, so I'm just creating the default textview and then. What I am doing here. I will add this and here. We have selected the table layout, Now what We have to do, We will go here. and select texture so then, We have to just code it here. We have to use a table here.


Design 

Every stable draw, when We do this you can see this is creating a little bit you can see here, so We have just ended, and this will be android let's say, So we have this and here. We have written the properties, let's say android height is web content and android yeah which is also and what We see in the design you can see it here, and what We will do, We will just increase the size of the text let's say print.  


It's looking good now. We have to select one more like this in this particular row only. We would create one more here. okayand something like that We will click remove this will create this will have roll number.


Code

We had a name stick here. We have to just close it here, and if you want to like if we actually edited the height. We have to edit the width of this match pantry. That's bad so now you can see and now what we'll do, We will create one module here. You will grow here. what We will do, We will just hit the same views like this now you can see and here. what we'll do, We will end the data of it. 


Testing

Let's see, and it seems like that will create one more if you want to edit its height or tweet then what We can do, We can also not We cannot do so here.


We have to line by line and if you go in design here. and select all select all and here. you go We can get a I think size button text size, so it's not

looking here. maybe it's somewhere. But, let's see this, now you can see that this is the coding part and this is the design pattern and what We will do, we'll just select the emulator program and this launching command with application here. You can see it's actually organised.


Output :



Written by Tarun Sikhwal.




Comments

Popular posts from this blog

VR Applications/Games Review | Top 5 VR Apps

Exploring the Future: Blogging in Virtual Reality

Augmented Reality (AR): Transforming the Blogging Experience