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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:49:11+00:00 2026-05-19T11:49:11+00:00

I have a n app widget that is pretty much working, with one quirk.

  • 0

I have a n app widget that is pretty much working, with one quirk. I’ve got a LinearLayout in the widget, and I can add rows of my data to it just fine. There doesn’t seem to be any obvious way for me to tell how big the linear layout is and if a given row will fit, so I just add the entire data set (since it isn’t very large). The text in my layout gets cropped at the bottom, which is what I’d expect. However, the ImageView next to it is not being cropped, but is instead being scaled. It, frankly, looks goofy.

If there’s a way for me to tell if a row will fit in my LinearLayout, that would be great. If there’s a way I can tell it to just crop my image, that would be fine too. This is what the cropping looks like.

The layout for the rows I’m adding (if there’s a goof here, it’s probably from the anonymization I applied):

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <ImageView 
        android:id="@+id/checkbox"
        android:layout_width="28sp"
        android:layout_height="28sp"
        android:src="@drawable/check_off"
        android:layout_marginLeft="5dp"
        android:layout_marginTop="1dp"
        android:layout_alignParentLeft="true"/>
    <TextView 
        android:id="@+id/textview"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:textSize="16sp"
        android:minHeight="28sp"
        android:paddingLeft="5dp"
        android:layout_centerVertical="true"
        android:layout_alignWithParentIfMissing="true"
        android:layout_toRightOf="@id/checkbox"/>
</RelativeLayout>

EDIT: The container for the rows is just a simple LinearLayout:

<LinearLayout
    android:id="@+id/list_items"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:layout_above="@id/logo"
    android:layout_marginBottom="4dp"
    android:padding="1dp"
    android:orientation="vertical"
    android:background="@drawable/widget_background"/>
  • 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-19T11:49:12+00:00Added an answer on May 19, 2026 at 11:49 am

    It turns out that giving the RelativeLayout that corresponds to the row a specific height (30sp, for this layout) instead of “wrap_content” fixed the problem. The image now crops correctly.

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

Sidebar

Related Questions

I have a script that appends some rows to a table. One of the
I have a little web app that uses the Facebook like widget. This page
We have an app with an extensive admin section. We got a little trigger
I have an app that needs to open a new window (in the same
I have an app written in C# that lies on a network share. When
I have an app where I create many uiviews and add them to the
I have an app that executes commands on a Linux server via SSH just
I have a app that I'm deploying to a development server using Capistrano. I'd
I have an app that is failing on the install. The vendor says I
I'm working on an app where we insert our app's widget into the body

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.