How to Scroll large image in ImageView Android Example
main.xml
<LinearLayout xmlns:android="//schemas.android.com/apk/res/android"
android:orientation="vertical"
android:gravity="top"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<HorizontalScrollView
android:id="@+id/horizontalScrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:gravity="top"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/imageViewObrazekGeometrie"
android:layout_width="360dp"
android:layout_height="777dp"
android:src="@drawable/geometrie_vzorecky" />
</LinearLayout>
</HorizontalScrollView>
</ScrollView>
</LinearLayout>
396LW NO topic_id
AD
Další témata ....(Topics)
Drawable dr = getResources().getDrawable(R.drawable.algebra);
int h = dr.getIntrinsicHeight();
int w = dr.getIntrinsicWidth();
Bitmap ball = BitmapFactory.decodeResource(getResources(), R.drawable.algebra);
int _nWidth = ball.getWidth();
int _nHeight = ball.getHeight();
public class Panel extends SurfaceView implements SurfaceHolder.Callback {
//............... code
//............... some code
/**
* Process the MotionEvent.
*/
@Override
public boolean onTouchEvent(MotionEvent event) {
synchronized (getHolder()) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
performClick();
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
if(_currentGraphic==null)return true;
} else if (event.getAction() == MotionEvent.ACTION_UP) {
}
return true;
}
}
/////////////////////////////
@Override
public boolean performClick() {
// Calls the super implementation, which generates an AccessibilityEvent
// and calls the onClick() listener on the view, if any
super.performClick();
// Handle the action for the custom click here
return true;
}
}
int[] mArrayOfInt;
String[] mArrayOfString;
List<String> mList;
public void saveState(Bundle map)
{
map.putIntArray("mArrayOfInt", mArrayOfInt);
map.putStringArray("mArrayOfString", mArrayOfString);
map.putStringArrayList("mList", mList);
}
public void restoreState(Bundle map)
{
mArrayOfInt= map.getIntArray("mArrayOfInt");
mArrayOfString = map.getStringArray("mArrayOfString");
mList = map.getStringArrayList("mList");
}
Eclipse update ADT 17 Android Emulator error: E/AndroidRuntime(370): java.lang.NoClassDefFoundError: com.google.ads.AdView
Solution:
-right click on the project in project tree and select Project properties
-select Java Build Path
-select TAB Order and Export
-check GoogleAdMobAdsSdk-4.0.4.jar (or your version SDK)
-press OK
-clean project by menu Project -> Clean
-rebuild project (Project - Build Automatically)
How add GoogleAdMobAdsSdk....jar to project:
-right click on the project in project tree and select Project properties
-select Java Build Path
-select TAB Libraries
-press the button Add External JARs...
-select your version GoogleAdMobAdsSdkXXX.jar what you can using
-OK
-OK
-clean project
-rebuild project
Solution:
-right click on the project in project tree and select Project properties
-select Java Build Path
-select TAB Order and Export
-check GoogleAdMobAdsSdk-4.0.4.jar (or your version SDK)
-press OK
-clean project by menu Project -> Clean
-rebuild project (Project - Build Automatically)
How add GoogleAdMobAdsSdk....jar to project:
-right click on the project in project tree and select Project properties
-select Java Build Path
-select TAB Libraries
-press the button Add External JARs...
-select your version GoogleAdMobAdsSdkXXX.jar what you can using
-OK
-OK
-clean project
-rebuild project
1.) Try delete some apps from Android emulator (can from Eclipse DDMS perspective
- File Explorer tab - data/apps folder path )
2.) Try resize emulator internal storage or SD card storage to hight size
3.)Try add to AndroidManifest.xml android:installLocation="preferExternal"
4.) Try resize particion from Eclipse
Preferences,
select Android- Launch
Add "-partition-size 1024" into "Default emulator option” field.
Click "Apply” and use your emulator as usual
- File Explorer tab - data/apps folder path )
2.) Try resize emulator internal storage or SD card storage to hight size
3.)Try add to AndroidManifest.xml android:installLocation="preferExternal"
<manifest xmlns:android="//schemas.android.com/apk/res/android"
package="com.myweb.mypackage"
android:installLocation="preferExternal"
4.) Try resize particion from Eclipse
Preferences,
select Android- Launch
Add "-partition-size 1024" into "Default emulator option” field.
Click "Apply” and use your emulator as usual
Editace: 2013-12-09 13:01:31
Počet článků v kategorii: 396
Url:how-to-scroll-large-image-in-imageview-android-example