Posts

Types of layout in Android

Image
There are numer of layouts provide by android,android application developer used different layout to give different look to application. Layout basically refers to the arrangement of elements on a page these elements are likely to be images, texts or styles. These layouts can have various widgets like buttons, labels, textboxes, and many others. Sr.No Description 1 Linear Layout LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally. 2 Relative Layout RelativeLayout is a view group that displays child views in relative positions. 3 Absolute Layout AbsoluteLayout enables you to specify the exact location of its children. 4 Table Layout TableLayout is a view that groups views into rows and columns. 5 Frame Layout The FrameLayout is a placeholder on screen that you can use to display a single view. 6 Grid View GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid. 7 List View ListView is a view group that display...

Constraint Layout with Appbar Layout

Image
  A Constraint Layout provide flexible layout design which reduce complexity of application layout design.This allow you to create large numbers of views easily with complex ,dynamic and responsive way.It help to improve the User Interface performance over other layouts.  with the help of constraintLayout ,we can position our User Interface components in any sort of order whether it may be horizontal or vertical.But in the case of LinearLayout,we can only arrange our User Interface components either in a horizontal or in a vertical manner. AppBarLayout provide scrolling behaviour which implement many of material design features.If you used AppBarLayout within a different ViewGroup ,most of its functionality will not work.AppBarLayout provide toolbar which have scrolling gestures. also Read : How to Create ImageButton With same Height and Width in Same Distance in Android Bellow code describe the AppBarLayout  which manage scrolling of entire view design with CoordinatorLa...

How to Create ImageButton With same Height and Width in Same Distance in Android

Image
In android or in any mobile application ,It is required that layout design of application is  fit in all size of mobile screen.So for that some time we need  calculation.  Here i provide code which not need any calculation. ImageButton  with fix Height and Width. If you don't want the buttons to scale, but adjust the spacing between the buttons (equal spacing between all buttons), you can use views with weight="1" which will fill the space between the buttons:     <LinearLayout android :id ="@+id/linearLayout" android :layout_width ="match_parent" android :layout_height ="50dp" android :orientation ="horizontal" android :background ="@color/splash_background_color" > < Space android :layout_width ="0dp" android :layout_height ="1dp" android :layout_weight ="1" ></ Space > < ImageButton android :id ="...