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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:14:25+00:00 2026-06-11T05:14:25+00:00

I have layout, which contain two parts: header and body. Header contain TextView and

  • 0

I have layout, which contain two parts: header and body. Header contain TextView and image. Header height can be changed programmatically. And header’s image and text must be scaled respectively. Image scaling ok, but text doesn’t want scaling. Is it possible on Android and how to do this?

My layout:

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

    <LinearLayout
        android:id="@+id/header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        tools:ignore="UseCompoundDrawables" >

        <TextView
            android:id="@+id/title_text"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/app_name" />

        <ImageView
            android:id="@+id/edit_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:contentDescription="@string/edit"
            android:src="@drawable/widget_edit" />
    </LinearLayout>

    <TextView
        android:id="@+id/content_text"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>
  • 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-11T05:14:26+00:00Added an answer on June 11, 2026 at 5:14 am

    I don’t think that this is viable with the default TextView – at least not without some hacking.

    I’d try using a custom View class for this, and draw the text on its Canvas. During the draw call, you know the exact width and height of the canvas and draw text with the appropriate font size.

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

Sidebar

Related Questions

I have a layout which looks like this: <LinearLayout> <ImageView> android:width=wrap_content android:height:wrap_content ... </ImageView>
I have a layout setup which can be view here: http://jsfiddle.net/Pn3ts/ It all works
I have created a table layout in which my table row height is too
Suppose I have two tables, t1 and t2 which are identical in layout but
I have created following layout.which has two relative layouts and one scrollview ,following code
I have a custom list view which contains two text views and on button.
I have the following table layout which I'm using to display image buttons in
I have a complex form to layout.Assume screen is equally divided into two parts
I have a layout which I am inflating in order to dynamically add TableRows
I have an xml layout which I use for each row in my listview:

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.