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 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 an app widget, which contains only one imageview. i redraw that image
I have a GWT 2.3 app that works fine in IE8 and pretty much
I have an app and its widget. What must I do, that I can
I have a widget that supposed to call an Activity of the main app
I have an app with a widget that loads an activity to perform an
I have a gwt app that requires GWT Recaptcha for one of its part.
I'm working on a widget that will change the data it is displaying when
I have an app and a widget. What must I do so that I
In a webOS app, I have a Mojo.Widget.Slider that I use to set an
I have one simple widget consisting in a simple button that launches the main

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.