1

I've got a large picture I'm trying to allow my users to view. I also want to add buttons over the picture at a later date to allow them to get more information about certain map points.

My XML is as follows:

<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:scrollbars="none">
<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="match_parent">

    <ImageView
        android:id="@+id/map_image"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:src="@drawable/map_1280" />

</RelativeLayout>

The reason I'm using a relative layout as the direct child is for placing the buttons later. The problem I'm having is the image isn't showing up. It's the same color as the background. However, I can scroll left and right for a bit before I get the glow that indicates the end of a scrollview. However, I can't see the picture.

I also added this to the Java, just in case:

setContentView(R.layout.map_view);
ImageView mapView = (ImageView)findViewById(R.id.map_image);
mapView.setImageResource(R.drawable.map_1280);

Still nothing. Am I doing something wrong? Image opens up fine, nothing's broken about it. It's a large 2000*1280 picture, and opens in other things fine.

The Holo Dev
  • 1,016
  • 3
  • 12
  • 22

1 Answers1

1

There are a few ways to do it. Following links could help you. Link 1 Link 2 Link 3

Community
  • 1
  • 1
san
  • 1,845
  • 13
  • 23