Basic design for android studio design Syntax design

Tech Solution, Tutorial 0 Comments

Basic design syntax for LinearLayout weightSum weight, EditText, image full size set, image show full screen, scroll view, horizontal scroll view android studio mobile app programming with example How to add direct library dependencies in android studio build.gradle(:app) file How to set alignment tutorial all Text button set in single line design.

First add build.gradle(:app) Direct Library Dependencies

 

<pre><code>

<LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:app=”http://schemas.android.com/apk/res-auto”
xmlns:tools=”http://schemas.android.com/tools”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:orientation=”vertical”
android:padding=”4dp”
tools:context=”com.shriramedu.sikar.shriramedu.MainActivity”>

<LinearLayout
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:layout_margin=”0dp”
android:orientation=”horizontal”>

<LinearLayout
android:layout_width=”fill_parent”
android:layout_height=”40dp”
android:weightSum=”5″
android:layout_margin=”0dp”>

<ImageView
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_weight=”1″
android:src=”@drawable/library”
android:onClick=”btn_website”
/>
<ImageView
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_weight=”1″
android:src=”@drawable/library”
android:onClick=”btn_website”
/>
<ImageView
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_weight=”1″
android:src=”@drawable/library”
android:onClick=”btn_website”
/>
<ImageView
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_weight=”1″
android:src=”@drawable/library”
android:onClick=”btn_website”
/>
<ImageView
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_weight=”1″
android:src=”@drawable/library”
android:onClick=”btn_website”
/>

</LinearLayout>
</LinearLayout>
</LinearLayout>

2nd design

<LinearLayout
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:weightSum=”5″>

<Button
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_weight=”1″
android:text=”1″ />

<Button
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_weight=”3″
android:text=”2″ />

<Button
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_weight=”1″
android:text=”3″ />

</LinearLayout>

ScrollView

<ScrollView
android:layout_width=”match_parent”
android:layout_height=”wrap_content”>

<LinearLayout
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:orientation=”vertical”>

<ImageView
android:layout_width=”40dp”
android:layout_height=”40dp”
android:src=”@drawable/homepage”
android:layout_centerInParent=”true”
/>

</LinearLayout>

</ScrollView>

<LinearLayout
android:layout_width=”match_parent”
android:layout_height=”wrap_content”>

<HorizontalScrollView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:fillViewport=”true”
android:scrollbars=”none”
>
<LinearLayout
android:layout_width=”match_parent”
android:layout_height=”90dp”
android:orientation=”horizontal”
android:paddingTop=”10dp”>
<ImageView
android:layout_width=”50dp”
android:layout_height=”50dp”
android:src=”@drawable/library”
android:layout_centerInParent=”true”
android:onClick=”btn_website”
/>
<ImageView
android:layout_width=”50dp”
android:layout_height=”50dp”
android:src=”@drawable/library”
android:layout_centerInParent=”true”
android:onClick=”btn_website”
/>

</LinearLayout>
</HorizontalScrollView>
</LinearLayout>

image show full screen

<ImageView
android:layout_width=”match_parent”
android:layout_height=”250dp”
android:scaleType=”fitXY”
android:adjustViewBounds=”true”
android:src=”@drawable/bannerfirst”/>

</pre></code>

 

 

LinearLayout weightSum weight design Download

Design-scroll-image-full-horizontal scroll

Basic design with 2 row set

Basic design with weight design

Basic design syntax for LinearLayout weightSum weight, EditText, image full size set, scroll view, horizontal scroll view android studio mobile app programming with example How to add direct library dependencies in android studio build.gradle(:app) file How to set alignment tutorial all Text button set in single line design.