Gallery missing attribute / method

by android_dev » Tue, 26 Aug 2008 01:40:23 GMT


Sponsored Links
 android.widget.Gallery:

What is the equivalent for these in SDK 0.9?


android:drawSelectorOnTop or setDrawSelectorOnTop(boolean)

android:spinnerSelector or setSelectorSkin(Drawable)


Thanks.
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Confused about 9-patch files

Can someone please explain or provide examples (links) of some valid 9-
patch files?


As an example, there's a 9-patch located at: http://www.maladroid.net/test.9.png

[the same idea, as abad ascii representation]

0 = transparent, 1 = black, 2 = red

010101010
102020200
102020200
102020200
102020200
000000000

So there are 3 single-red-pixel columns, with stretchable areas
defined between them. It seems like this should resize to any aspect
ratio and there will still be 3 single-pixel red columns. My thinking
is that the solid black border on the left means "scale uniformly in
the y-direction" and that a pixel in the top row above the transparent
columns means "scale the transparent area, but leave the red columns
with width=1 pixel".

Is that the correct interpretation of black/transparent pixels?

Using the draw9patch tool, it doesn't scale if I make the left-border
completely black, but if I remove any one pixel, then it scales - why
is that?

When working in Eclipse, after refreshing the /drawables folder,
sometimes my 9-patch doesn't show up in the R.java file, presumably
because it is somehow invalid. Yet, I can still refer to it and use it
in the Layout Editor. Am I correct to assume there's something wrong
with the 9-patch? Or perhaps there's something wrong with my (default
eclipse plugin) build process?

Thank you for any suggestions.



--~--~---------~--~----~------------~-------~--~----~

2. Hoping to change widget attributes by selecting a menu item

Hi,

I am writing a program that involves a menu. Once you press the menu
button
and then select "Left",  it's supposed to change the attributes of
myButton12, an ImageButton.

However, I am getting a "myButton12 cannot be resolved" error message.
Please help me figure out what is wrong with this code.

Thanks!
-Jimmy



The code:

package com.innodesign.testingbuttons;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AbsoluteLayout;
import android.widget.ImageButton;
import android.widget.Button;
import android.widget.EditText;
import android.net.Uri;
import android.content.Intent;

@SuppressWarnings("unused")
public class TestingButtons extends Activity {
       protected void onCreate(Bundle icicle) {
               super.onCreate(icicle);
               setContentView(R.layout.main);

               final ImageButton myButton12 = (ImageButton)
findViewById
(R.id.btid12);
               myButton12.setOnClickListener(new View.OnClickListener
()
{
               public void onClick(View v) {
               // Perform action on click
                       phoneNumber.setText(phoneNumber.getText()+"#");
                       }
               });
       }

   @Override
   public boolean onCreateOptionsMenu(Menu menu){
       super.onCreateOptionsMenu(menu);

               menu.add(0, 1, 0, "Left");
               menu.add(0, 2, 0, "Right");
   return true;
   }

       @Override
       public boolean onOptionsItemSelected(MenuItem item){
               switch(item.getItemId()){
               case 1:
                       shiftLeft();
               return true;
               case 2:
               return true;
               }
       return true;
       }

       public void shiftLeft(){
               myButton12.setLayoutParams(new
AbsoluteLayout.LayoutParams(10, 10,
10, 10));

       }
}

--~--~---------~--~----~------------~-------~--~----~

3. How to update View object on main thread by background thread

4. Activity lifecycle, saving to a database, and remembering row IDs

5. How to Build kernel with android build system?

6. Zygote process died due to SIGSEGV

7. Issue in openintents simulator, after running directly going to "Connection settings" page instead of my desired page