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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:15:06+00:00 2026-06-12T18:15:06+00:00

Hey im having trouble with these linear layouts in android xml. initially i did

  • 0

Hey im having trouble with these linear layouts in android xml. initially i did them in a relative layout and it worked fine, but after some research i discovered that relative layouts inside of a scrollview doesnt work supposedly. so now after much tweaking my imageview shows up but has a huge margin above and below it and my textview doesnt even show up aside from being where its supposed to in the graphics editor but blank.

so whats wrong? should i even be using a linear layout?

this is roughly what its supposed to look like http://www.mediafire.com/view/?z945tz2vrb2x46t

and this is what it looks like after Abdul and Ralgha’s help as well as setting the base linear layout’s height to wrap content http://www.mediafire.com/view/?px17q2z3yyeo8az

Thanks

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ScrollView
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:id="@+id/LinearLayout1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        >
        <TextView 
            android:id="@+id/today"
            android:src="@string/today"
            android:textSize="30dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_width="fill_parent"
            />
        <ImageView
            android:id="@+id/image1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:src="@drawable/weeklylist_blocks"
            />

     </LinearLayout>
</ScrollView>

</LinearLayout>


`![screwed up layout][1]
  • 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-06-12T18:15:07+00:00Added an answer on June 12, 2026 at 6:15 pm

    Don’t worry about weight right now, leave it removed. In your TextView, change “android:src” to “android:text” (without the quotes naturally). If that alone doesn’t solve it, remove the textSize line and see what happens. If that works, then you can start playing with sizes (and weights if needed).

    Also, textSize should be given in sp rather than dp. sp is for text, dp is for everything else, though that’s not what is causing your problem.

    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    
        <LinearLayout
            android:id="@+id/LinearLayout1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            >
            <TextView 
                android:id="@+id/today"
                android:textSize="30sp"
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:text="@string/today"
                />
            <ImageView
                android:id="@+id/image1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:src="@drawable/weeklylist_blocks"
                />
    
        </LinearLayout>
    </ScrollView>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys I am having trouble with placing my buttons in my XML layout.
Hey guys I'm having trouble looping through some XML. Im trying to capture the
Hey I'm having some trouble understanding how Recursive Algebraic Types work and how to
Hey smarties. I'm having trouble with the following SQL statement. I know that I
Hey all! Having a little trouble with my stack. Im trying to print each
Hey im new to database design and having trouble trying to figure this one
Hey guys, I'm having some trouble with a screen from the app I'm developing.
Hey guys I am having a lot of trouble trying to understand this and
Hey I'm having trouble figuring out how to get my template header to work.
hey people im having trouble with loading my array of strings into a tableview

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.