Dynamic Layout- Table Layout
package androiindians.helloworld; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.text.InputType; import android.widget.Button; import android.widget.EditText; import android.widget.TableLayout; import android.widget.TableRow; import android.widget.TextView; public class MainActivity extends AppCompatActivity { TableLayout TL; TableRow tr1, tr2, tr3;…
Dynamic Layout- Linear Layout
package androiindians.helloworld import android.os.Bundle; import android.app.Activity; import android.widget.LinearLayout; import android.widget.TextView; public class MainActivity extends Activity { LinearLayout ll; TextView tv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ll = new…
Dynamic Layout
Creating Layout at runtime UI Component can be created programmatically. UI component class setter methods help to configure the component. This style is not recommended unless it’s really required. In…
Constraint Layout
The ConstraintLayout is a powerful new class, imagine a RelativeLayout on steroids – yea, that’s the ConstraintLayout. It allows us to lay out child views using ‘constraints’ to define position…
Grid Layout
<?xml version="1.0" encoding="utf-8"?> <GridLayout android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" > <Button android:layout_width="188dp" android:layout_height="wrap_content" android:text="hello" /> <Button android:layout_width="113dp" android:layout_height="wrap_content" android:text="hii" /> <Button android:layout_width="188dp" android:layout_height="wrap_content" android:text="hello" /> <Button android:layout_width="113dp" android:layout_height="wrap_content" android:text="hii" /> </GridLayout>
Absolute Layout
An Absolute Layout lets you specify exact locations (x/y coordinates) of its children. Absolute layouts are less flexible and harder to maintain than other types of layouts without absolute positioning.…
Frame Layout
FrameLayout is designed to block out an area on the screen to display a single item. Generally, FrameLayout should be used to hold a single child view, because it can…