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 6694377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:05:41+00:00 2026-05-26T06:05:41+00:00

First of all, I am new to Android development so this might be a

  • 0

First of all, I am new to Android development so this might be a simple issue but I really can’t get it working.

I have the following layout.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
              android:orientation="vertical" 
              android:layout_width="fill_parent" 
              android:layout_height="fill_parent"
              android:weightSum="1">

    <FrameLayout android:id="@+id/navigationBarFrameLayout" 
                 android:layout_width="fill_parent"
                 android:layout_height="44dp">
        <ImageView android:id="@+id/navigationBar"
                   android:src="@drawable/navigationbar"
                   android:layout_width="fill_parent" 
                   android:layout_height="fill_parent"
                   android:scaleType="centerCrop"/>
        <TextView android:text="TextView"
                  android:layout_width="fill_parent" 
                  android:id="@+id/navigationBarTitle" 
                  android:layout_height="fill_parent" 
                  android:gravity="center_vertical|center_horizontal"
                  android:textColor="#000" 
                  android:textSize="24sp" 
                  android:textStyle="bold"
                  android:shadowColor="#fff"
                  android:shadowDy="-1" 
                  android:shadowDx="0"
                  android:shadowRadius="1"/>
    </FrameLayout>

    <android.support.v4.view.ViewPager 
             android:layout_width="fill_parent"
             android:id="@+id/DayPager"
             android:layout_height="82dp">
    </android.support.v4.view.ViewPager>

    <RelativeLayout android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:id="@+id/relativeLayout">
        <HorizontalScrollView android:id="@+id/ScheduleScrollView" 
                                  android:layout_width="wrap_content" 
                                  android:layout_height="fill_parent"
                                  android:fadingEdge="none" 
                                  android:layout_above="@+id/tabBarFrameLayout"
                                  android:scrollbars="none" 
                                  android:background="#00ff00">
            <RelativeLayout android:id="@+id/ScheduleRelativeLayout" 
                                    android:layout_height="fill_parent"
                                    android:layout_width="wrap_content">
                <RelativeLayout android:layout_width="fill_parent" 
                                            android:layout_height="wrap_content" 
                                      android:id="@+id/ScheduleTimelineRelativeLayout">
                            </RelativeLayout>
                <RelativeLayout android:layout_width="fill_parent"
                                            android:layout_height="fill_parent" 
                                      android:id="@+id/ScheduleConcertsRelativeLayout"
                            android:layout_below="@+id/ScheduleTimelineRelativeLayout"
                                            android:background="#ff0000" 
                                            android:layout_weight="1">
                           </RelativeLayout>
            </RelativeLayout>
        </HorizontalScrollView>

        <FrameLayout android:id="@+id/tabBarFrameLayout" 
                     android:layout_height="49dp"
                     android:layout_width="wrap_content" 
                     android:layout_alignParentBottom="true" 
                     android:layout_alignParentLeft="true" 
                     android:layout_alignParentRight="true">
            <ImageView android:id="@+id/imageView1" 
                       android:src="@drawable/tabbar" 
                       android:layout_width="wrap_content" 
                       android:layout_height="wrap_content" 
                       android:scaleType="centerCrop"/>
        </FrameLayout>     
    </RelativeLayout>

</LinearLayout>

What you see is that I have a horizontal scrollview (ScheduleScrollView) which has two relative layouts. The upper one contains a timeline (ScheduleTimelineRelativeLayout) while the lower one (ScheduleConcertsRelativeLayout) will contain some buttons created programmatically. The horizontal scrollview is as wide as the timeline. I would like the lower relative layout to fill it’s parent, meaning that it should be as wide as the horizontal scrollview but this doesn’t work.

I have searched this forum trying to find an answer to my question. Some suggests using android:layout_width="match_parent" but when doing so, I will get the following error:

Error: String types not allowed (at ‘layout_width’ with value
‘match_parent’)

Others suggests setting android:layout_weight="1" but this changes nothing (and the setting is not available in my autocomplete so it seems that it doesn’t exist)

The screenshot below shows my issue. The green part is the background color of my horizontal scrollview. This should not be visible. Instead the lower red part should go to the edge.

enter image description here

UPDATE:

enter image description here

UPDATE:

Setting the width and height of ScheduleConcertsRelativeLayout programatically after the layout has been laid is working.

RelativeLayout timeline = (RelativeLayout) findViewById(R.id.ScheduleTimelineRelativeLayout);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(timeline.getWidth(), scheduleConcertsRelativeLayout.getHeight());
params.setMargins(0, timeline.getHeight(), 0, 0);
scheduleConcertsRelativeLayout.setLayoutParams(params);
  • 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-26T06:05:42+00:00Added an answer on May 26, 2026 at 6:05 am

    Setting the width and height of ScheduleConcertsRelativeLayout programatically after the layout has been laid is working.

    RelativeLayout timeline = (RelativeLayout) findViewById(R.id.ScheduleTimelineRelativeLayout);
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(timeline.getWidth(), scheduleConcertsRelativeLayout.getHeight());
    params.setMargins(0, timeline.getHeight(), 0, 0);
    scheduleConcertsRelativeLayout.setLayoutParams(params);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

first of all I'm totally new to FAST but I already have a couple
First of all I have to say I am new to iOS development. My
I am new to Android development and am facing a slight issue. My first
First time poster. Im totally new to Android but I have manged to dreate
I have been searching all over but I can't find any answer to this.
Hi all I am new to android development, infact its my first application. I
First of all, I'm really new to the MVC Asp.Net ideology. I would like
First of all, I'm fairly new to Java, so sorry if this question is
I have been slowing learning and building my first android app. I'm VERY new
First of all try to be patient I'm new in both android and asking

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.