Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4333830
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:26:47+00:00 2026-05-21T10:26:47+00:00

I understand the functionality of liner and relative layout. But I am confused which

  • 0

I understand the functionality of liner and relative layout.

But I am confused which one to pick for the activity since I can full fill my requirment with both of them.

As I am working on emulator , So I think I am missing something, Is there any guidance or litmus on when to use which layout ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:26:47+00:00Added an answer on May 21, 2026 at 10:26 am

    This is how I nest the various views. from this example you can see that I use the ScrollView at the lowest level so that the view can scroll easily.

    I then use the linear layout ontop of the scrollview so that I can simply stack widgets on the screen row by row.

    Finally, I use the RelativeLayout so that I can use the “layout_alignParentBottom” parameter and make the button show on the bottom of the view.

    <?xml version="1.0" encoding="utf-8"?>
    
    <!-- use ScrollView incase it doesn't fit on small display -->
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:fillViewport="true"
              android:background="#fffcb95a">
    
        <LinearLayout android:orientation="vertical"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent">
    
            <!-- Hello World -->
            <TextView android:text="Hello World" 
                      android:id="@+id/TextViewHeaderMessage1" 
                      android:layout_width="fill_parent" 
                      android:layout_height="wrap_content"
                      android:paddingTop="8dip"
                      android:textAppearance="?android:attr/textAppearanceLarge"
                      android:gravity="center_horizontal"
                      android:paddingBottom="30dip"
                      android:textColor="#6a7349" />
    
    
    
            <RelativeLayout android:orientation="horizontal"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content">
    
                <!-- "OK" BUTTON -->
                <Button android:text="OK" 
                        android:id="@+id/ok_button" 
                        android:layout_width="150dip" 
                        android:layout_height="wrap_content"
                        android:layout_alignParentBottom="true"
                        android:layout_centerHorizontal="true" />
    
            </RelativeLayout>
    
        </LinearLayout>
    
    </ScrollView>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand Objective-C memory management but I'm using Core Graphics functionality such as CGRect,
I understand I can create an enum like this: public enum MyEnum { ONE(1),
I have tricky problem which I can't completely understand. It's jQuery tabs with cookie
I'm trying to understand the mechanics of creating a password reset functionality for a
I understand this is an easy question but for some reason this just isn't
I understand what weak tables are. But I'd like to know where weak tables
I understand mostpayment gateway just deposit all incoming payment to one account. IS it
I understand that on Linux there is a kernel functionality referred to as OOM
I'm trying to understand how gems work, and how you can create a gem
I'm adding some custom logging functionality to a bash script, and can't figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.