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

  • Home
  • SEARCH
  • 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 8054015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:02:29+00:00 2026-06-05T08:02:29+00:00

What I want to do is make a centered box containing some text blurbs

  • 0

What I want to do is make a centered box containing some text blurbs and a button to proceed. I was able to get the box centered and not taking up the entire screen by using wrap_content, but the blurbs are several lines long, and the textviews containing them are not showing all the text. Here is what I have:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center"
    android:background="@color/background"
    android:orientation="vertical" >


    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_gravity="center"
        android:background="@color/content"
        android:padding="10dp"
     >

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:gravity="center"
            android:text="@string/title"
            android:textColor="@color/black" />

       <TextView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:text="@string/teacher_head" 
            android:textColor="@color/black" />

        <TextView
            style="@style/home_blurb"
        android:text="@string/teacher_blurb" />

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:text="@string/student_head"
            android:textColor="@color/black"  />

        <TextView
        android:text="@string/student_blurb" 
            style="@style/home_blurb" />


        <Button
            android:layout_width="wrap_content"
        android:layout_height="0dip"
        android:layout_gravity="center"
        android:layout_weight="0.1"
        android:gravity="center"
            android:paddingTop="5dp"
            android:text="@string/go_to_app" />


</LinearLayout>
</LinearLayout>

where home_blurb is

<style name="home_blurb" parent="android:TextAppearance">
    <item name="android:paddingBottom">5dp</item>
    <item name="android:textColor">@color/black</item>
    <item name="android:layout_width">fill_parent</item>
    <item name="android:layout_height">fill_parent</item>
    <item name="android:layout_weight">1</item>
    <item name="android:textSize">12dp</item>     
</style>

The inner LinearLayout sets itself to the width of the button, which I’m okay with, but is there any way to make it wide enough to contain all the text without setting particular pixel measurements (like screen percentage in html/css)?

  • 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-05T08:02:30+00:00Added an answer on June 5, 2026 at 8:02 am

    you can use in your second LinearLayout

    android:layout_marginLeft="20dp"
    android:layout_marginRight="20dp"
    android:layout_marginBottom="20dp"
    android:layout_marginTop="20dp"
    

    so that your layout will remain in center with some space around it every time no matter how much big your text is.

    if you want you can give scroll bars to each element you can do it by adding with specific max height for each element then you can do this

    android:scrollbars="vertical" and in code textview.setMovementMethod(new ScrollingMovementMethod());

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i make a UITabBar without Images? I just want text, centered in
I have not been able to make a html5 button with a span inside
Let's say I want make some of my sources publicly available via my blog
i'm trying to make a menu, i want my menu looks like centered to
I want to make drop-down list for categories. How to make text inside select
I want to make my app to draw a circle centered at the touch
So what i want. There will be some content centered on a page (horizontally
I want make something like animation. I have four UIImageView (names: IW1, IW2, IW3,
I want make datetimepicker in my project. Using jquery how it is possible? I
I want make a bash script which returns the position of an element from

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.