ImageView in ListActivity won't scale...

by MagouyaWare » Wed, 21 Apr 2010 06:57:31 GMT


Sponsored Links
 I posted this same question on StackOverflow two days ago and haven't
received a response yet so I figured I would try my luck on here.  For
those interested here is the link to stackoverflow:
 http://stackoverflow.com/questions/2661223/imageview-scale-type-not-working-in-list-activity 

I have used ImageView's before and understand the different scale
types that can be set... However I am having an incredibly difficult
time trying to get an ImageView to scale properly in the row of a
ListActivity or an ExpandableListActivity.

I have tried setting the android:scaleType property to every single
value but the image never scales down. I have set the min and max
sizes as well and they don't seem to have any effect. I have done both
of these things in both the XMl and in code to no avail...

Does anyone have any ideas or perhaps a workaround?

Here is the XML for my group row for an ExpandableListView:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
        xmlns:android=" http://schemas.android.com/apk/res/android" ;
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="6dip"
        <ImageView
                android:id="@+id/item_selection_icon_id"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="5dp"
                android:layout_marginLeft="30dp"
                android:minWidth="10dp"
                android:minHeight="10dp"
                android:maxWidth="10dp"
                android:maxHeight="10dp"
                android:scaleType="centerInside"
        />

        <!--  App Name -->
        <TextView
                android:id="@+id/item_app_name_id"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_toRightOf="@id/item_selection_icon_id"
                android:layout_alignBaseline="@id/item_selection_icon_id"
                android:textStyle="normal|bold"
                android:textSize="24sp"
        />

        <!-- Package Information -->
        <TextView
                android:id="@+id/item_app_pkg_name_id"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/item_app_name_id"
                android:layout_toRightOf="@id/item_selection_icon_id"
                android:layout_weight="2"
                android:textStyle="italic"
                android:textSize="12sp"
        />
</RelativeLayout>


Thanks in advance for any help!

--



ImageView in ListActivity won't scale...

by Justin Anderson » Thu, 22 Apr 2010 07:57:43 GMT


 or anyone else who is having the same problem I have the answer!

I have updated the stackoverflow question as well, but the solution is to
remove the lines to specify the min and max sizes and to specify the exact
value in android:layout_width and android:layout_height instead of
wrap_content

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Tue, Apr 20, 2010 at 4:57 PM, MagouyaWare <magouyaw...@gmail.com> wrote:

>


Sponsored Links


Other Threads

1. Important: XmlPullParserException while accessing SOAP webservice

Hello,
   I am trying to access webservice using KSOAP 2 ... I am having problem
with accessing webservice...Below are my parameters

private static final String SOAP_ACTION = "
http://schemas.kickapps.com/services/soap/signInRegisterUser";
 private static final String METHOD_NAME= "signInRegisterUser";
private static final String NAMESPACE = "
http://schemas.kickapps.com/services/soap/";
 private static final String URL = "
http://affiliate.kickapps.com/soap/KaSoapSvc";

 SoapSerializationEnvelope soapEnvelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);

        SoapObject Request = new SoapObject(NAMESPACE,METHOD_NAME);
        Request.addProperty("affiliateUserName","xxxxx");
        Request.addProperty("affiliateEmail","x...@xxxxx.com");
        Request.addProperty("affiliateSiteName","xxxxxx");
        Request.addProperty("userName","avdTest");
        Request.addProperty("email","xx...@xxx.com");
        Request.addProperty("firstName","Aks");
        Request.addProperty("LastName","Test");
        Request.addProperty("LastName","Test");
        Request.addProperty("adminTags","1234565");
        Request.addProperty("gender","M");
        Request.addProperty("birthday","1960-01-01");
        Request.addProperty("password","testapps10");
        Request.addProperty("key","68fbdfd1");
        Request.addProperty("aboutMe","Hey");
        Request.addProperty("postalCode","12345");
        Request.addProperty("genRestApiToken","T");
        //soapEnvelope.dotNet = true;
        //soapEnvelope.bodyOut = Request;
       soapEnvelope.setOutputSoapObject(Request);

        //@SuppressWarnings("deprecation")
         HttpTransportSE transport = new HttpTransportSE(URL);
//AndroidHttpTransport aht= new AndroidHttpTransport(URL);


        try{

        transport.call(SOAP_ACTION, soapEnvelope);
        SoapPrimitive resultSOAP =
(SoapPrimitive)((SoapObject)soapEnvelope.bodyIn).getProperty(0);
         Toast.makeText(ULocalInput.this,"Hi",Toast.LENGTH_LONG).show();
        //SoapPrimitive resultString =
(SoapPrimitive)soapEnvelope.getResponse();
        tv.setText("Status:" + resultSOAP.toString());
        }  catch (IOException e) {
           e.printStackTrace();
           System.out.println("SOAP Error : " + e.getMessage());
           System.out.println("SOAP Response : " + transport.responseDump);
           tv.setText("Status1:" + e.getMessage());
          } catch (XmlPullParserException e) {
           e.printStackTrace();
           System.out.println("SOAP Error : " + e.getMessage());
           System.out.println("SOAP Response : " + transport.responseDump);



           tv.setText("Status2:" + e.getMessage());
          }


I don't know wht's going wrong here but I am getting error as
expected:END_TAG{http://schemas.xmlsoap.org
/soap/envelope/}Body(position:END_TAG{http://schemas.xmlsoap.org/soap/envelope/}soap:Fault>@1:354
in java.io.InputStreamReader@43e52820)

  I would appreciate if anyone can suggest me what am I doing wrong..

Many Thanks
Akshay

-- 

2. ContentProvider for streaming date from one app to another

Hi guys,
I'm just wondering if it is possible to stream data via an Input/
Outputstream from one app to another. We want to provide an
application API, where other applications can connect to. These other
applications should than send our application any kind of bytes via a
stream. Currently we focus more or less only on audio streams, so that
f.e. a certain player can send the audio stream to our application.

Kind regards
fritzr

-- 

3. Connect to a specific WiFi network

4. image for SET_WALLPAPER intent on Xoom

5. How to connect two devices using Wi-Fi

6. Trying to use JarSigner.exe and adb.exe to sign and install app to emulator

7. error: Finalizing a Cursor that has not been deactivated or closed.