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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:49:38+00:00 2026-05-29T03:49:38+00:00

I just started coding a new application for Android and stumble over a warning.

  • 0

I just started coding a new application for Android and stumble over a warning.

This tag and its children can be replaced by one and a compound drawable

Another problem I have is the image placed on the right side. How can I do this without having trouble with layout_wight? See image ([2], yellow and green highlight).

I would like to follow the android design guide and prevent warnings. So how do I solve this? Actual my code looks like:

<LinearLayout
    android:id="@+id/mainTitleLinearLayout"
    android:layout_width="match_parent"
    android:layout_height="48dp"
    android:orientation="horizontal" >

    <ImageView
        android:id="@+id/mainTitleImageView"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:padding="8dp"
        android:src="@drawable/ic_launcher"
        android:contentDescription="@string/app_name"/>


  <TextView
      android:id="@+id/mainTitleTextView"
      android:layout_width="fill_parent"
      android:layout_height="48dp"
      android:gravity="left|center_vertical"
      android:paddingBottom="4dp"
      android:paddingLeft="0dp"
      android:paddingRight="0dp"
      android:paddingTop="4dp"
      android:text="@string/app_name"
          android:textAppearance="?android:attr/textAppearanceMedium" />

</LinearLayout>
<LinearLayout android:layout_width="match_parent" android:layout_height="2dp" android:background="#0099CC"></LinearLayout>

Do you guys know some good tutorials for building custom components so I do not get this error again or/and solve the placement problem?

1 http://developer.android.com/design/style/metrics-grids.html

enter image description here

  • 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-29T03:49:39+00:00Added an answer on May 29, 2026 at 3:49 am

    That’s not an error, just an information (or a warning) that there is a more efficient way to achieve a row in the layout consisting of an image and a text view. You can do it like this:

    <?xml version="1.0" encoding="utf-8"?>
    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/text1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:drawableLeft="@drawable/error_tab"
        />
    

    The drawableLeft attribute adds the given drawable to the left of the text view. In a similar way you can place the image to the right.

    However, you will not be able to fine tune the position of the image wrt. the text view.

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

Sidebar

Related Questions

I have just started working on my first Android application and am going ok.
I'm fairly new to coding and just recently started working on integrating functions into
I'm new to Maven. I've just installed and configured it. When I started coding,
Just started coding in AS3 with FlashDevelop and coming from a C# background, I
I have just started coding in AS3 and it would be really great to
Just started my first MVC 2.0 .net application. And I set up some default
I just started a new project, and now with ASP.NET MVC being designed in
I've just started a new job and one of the things my new boss
So I'm really new to programming, I just started learning Python yesterday and I'm
I've started a new job this week and am trying to get my head

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.