메모장 어플 같은거 보면 큰 사진 첨부해도
알아서 작은 사이즈로 축소되어서 메모장에 붙던데요.
저는 width에 맞춰서 사진이 작아는지는데,
height는 원본 사이즈만큼 공백이 생기네요
구현은 대략 아래와 같아요 ㅠ
고수님들에 많은 의견 부탁드려요~^^
<FrameLayout android:layout_width="fill_parent" android:layout_height="380px">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<RelativeLayout
android:id="@+id/page"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#E6E0EC"
android:padding="5px"
>
<ImageView
android:id="@+id/picture"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:src="@drawable/modified_wad"
/>
...
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType(android.provider.MediaStore.Images.Media.CONTENT_TYPE);
intent.setData(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, REQ_CODE_PICK_PICTURE);
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQ_CODE_PICK_PICTURE) {
if (resultCode == Activity.RESULT_OK) {
ImageView img = (ImageView)findViewById(R.id.picture);
img.setImageURI(data.getData()); // 사진 선택한 사진URI로 연결하기
}
}
}



