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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:08:14+00:00 2026-05-31T19:08:14+00:00

This is the normal: This is the weird,when I scroll the listview some item

  • 0

This is the normal:

This is the normal

This is the weird,when I scroll the listview some item shrinked(But the value of width and height did not change.):

some items zoom-out

In this screenshot item[1:3] is same kind,but item[ 3] didn’t scale. which item scaled seem randomization maybe base the device or content.

The code of ListView and Adapter is nothing special :

mListView = new ListView(mContext);
mListView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
mProviderAdapter = new ProviderAdapter();
mListView.setAdapter(mProviderAdapter);


class ProviderAdapter extends BaseAdapter {

        @Override
        public int getCount() {
            return mCount;
        }

        @Override
        public Object getItem(int position) {
            return mProviders.get(position);
        }

        @Override
        public long getItemId(int position) {
            return mProviders.get(position).mMsgSpace;
        }

        @Override
        public int getViewTypeCount() {
            return 10000;
        }
        @Override
        public int getItemViewType(int position) {
            // TODO Auto-generated method stub
            return (position);
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            return mProviders.get(position).getUI().getView();
        }

    }

the screenshot of Hierarchy Viewer(Lower Right Corner):Link
enter image description here

and here is the custom views:

<?xml version="1.0" encoding="UTF-8"?>
<ViewAnimator xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#44FFFFFF" >


        <LinearLayout
            android:id="@+id/word"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal" >

                <TextView
                    android:id="@+id/content"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="#EC5800"
                    android:textSize="24sp" />

                <TextView
                    android:id="@+id/pron"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="bottom" />
            </LinearLayout>

            <TextView
                android:id="@+id/definition"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="20sp" />

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal" >

                <Button
                    android:id="@+id/add"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:padding="16dp"
                    android:text="@string/add"
                    android:textSize="20sp" />

                <Button
                    android:id="@+id/sound"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="16dp"
                    android:contentDescription="@string/audio"
                    android:padding="16dp"
                    android:text="@string/audio"
                    android:textSize="20sp" />

                <Button
                    android:id="@+id/switch_button"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="16dp"
                    android:contentDescription="@string/audio"
                    android:padding="16dp"
                    android:text="@string/definition"
                    android:textSize="20sp" />

            </LinearLayout>
        </LinearLayout>

    <LinearLayout
        android:id="@+id/login"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <Button
            android:id="@+id/login_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="Login" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/blank"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    </LinearLayout>

</ViewAnimator>

another view:

<?xml version="1.0" encoding="utf-8"?>
<ViewSwitcher xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ViewSwitcher1"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:id="@+id/example_panel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/example_1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Medium Text"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <TextView
            android:id="@+id/example_zh_1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="TextView" />

        <TextView
            android:id="@+id/example_2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="Medium Text"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <TextView
            android:id="@+id/example_zh_2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="TextView" />

        <Button
            android:id="@+id/switchto_note"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Button" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/note_panel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <EditText
            android:id="@+id/note_input"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="textMultiLine" >

            <requestFocus />
        </EditText>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <Button
                android:id="@+id/comfirm"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Button" />

            <Button
                android:id="@+id/cancel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Button" />
        </LinearLayout>
    </LinearLayout>

</ViewSwitcher>
  • 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-31T19:08:15+00:00Added an answer on May 31, 2026 at 7:08 pm

    @mice ‘s comment will fix the problem.

    @Override
    public int getItemViewType(int position) {
        return IGNORE_ITEM_VIEW_TYPE
    }
    

    because this problem cause by the listview’s recycle mechanism(a little more complicated ,I’m still learning,Can’t explain more 🙁 )

    more accurate is the view’s cache mechanism.

    But It can’t explain the weird scaling.

    After more test, I finally find the weird scaling is a compatibility problem.
    add <uses-sdk android:minSdkVersion="4"/> to AndroidManifest.xml will fix it .

    why?

    Display display = getWindowManager()
            .getDefaultDisplay();
    int width = display.getWidth();
    int height = display.getHeight();
    View v  = getWindow().findViewById(Window.ID_ANDROID_CONTENT);
    String s = "DisplayMetrics:"
            + getResources().getDisplayMetrics()
            + "\nview : "
                + v.getWidth()+"*"+v.getHeight()
                + "\nscreen:" + width + "*" + height;
    

    Before:

    before

    After:

    after

    So if didn’t add the android:minSdkVersion, View.buildDrawingCache(boolean autoScale) will return the wrong cache bitmap,that’s why the weird scaling happend.

    btw:return 10000 or any other values in the getViewTypeCount didn’t make sense. because I found the system never call it.

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

Sidebar

Related Questions

I haven't got clue if this is a normal issue or not but I
EDIT: It works but it takes amazingly long to complete. Is this normal, or
OK, this may sound weird, but here goes. There are 2 computers, A (Pentium
Is this normal, or is there something weird with my program?: i wrote a
I've tested this and it works fine, but it looks... weird... to me. Should
This is some weird problem. I'm building a new layout in localhost. The layout
from this (normal dataGrid) (source: narod.ru ) into this (horisontal data grid) How to
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
I am wondering is this normal when you add this into your web.config <location
Resharper doesn't recognise Rowtests, is this normal? Is there anyway to fix it? (

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.