Android - Ayuda con ImageButton

 
Vista:

Ayuda con ImageButton

Publicado por Victor (2 intervenciones) el 24/05/2016 10:08:46
Tengo una duda sobre como poder clicar a una imageButton y que te aparezca otro menú vació solo con esa imagen y abajo un texto, estamos haciendo un proyecto de clase y recién somos iniciados en esto, me seria de mucha ayuda, gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Ayuda con ImageButton

Publicado por Edgar Giovanni Andrade Santamaría (2 intervenciones) el 27/05/2016 00:31:47
QUE ONDA....

primero debes crear un Layout.

1
2
3
4
5
6
7
8
9
10
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
 
 <ImageView android:id="@+id/image_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
 
</LinearLayout>





depues crea el Activity para que cargue la imagen...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public class Main extends Activity {
    private ImageView imageView;
    private Bitmap loadedImage;
    private String imageHttpAddress = "http://jonsegador.com/wp-content/apezz.png";
 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        imageView = (ImageView) findViewById(R.id.image_view);
        downloadFile(imageHttpAddress);
    }
 
    void downloadFile(String imageHttpAddress) {
        URL imageUrl = null;
        try {
            imageUrl = new URL(imageHttpAddress);
            HttpURLConnection conn = (HttpURLConnection) imageUrl.openConnection();
            conn.connect();
            loadedImage = BitmapFactory.decodeStream(conn.getInputStream());
            imageView.setImageBitmap(loadedImage);
        } catch (IOException e) {
            Toast.makeText(getApplicationContext(), "Error cargando la imagen: "+e.getMessage(), Toast.LENGTH_LONG).show();
            e.printStackTrace();
        }
    }
}

MUCHA SUERTE.... SALUDOS
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar

Ayuda con ImageButton

Publicado por Victor (2 intervenciones) el 27/05/2016 08:55:47
Probare el código.

Muchas gracias!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar