제가 하고자 하는 것은
하나의 이미지를 Bitmap으로 소스에서 가로 두개로 나눕니다.
그리고 아래의 View안의 ImageView에 나눈 이미지를 왼쪽, 오른쪽 나눠서 넣습니다.
결과를 보면 이미지의 넓이가 화면보다 작은 것을 반으로 나누었을 경우
이미지 사이에 공간이 생겨서 나뉜 두개의 이미지가 떨어져 보입니다.
제가 원하는 것은 붙어있는 상태입니다.
하여 왼쪽 ImageView 에 android:scaleType="fitEnd" 속성을, 오른쪽 ImageView에 android:scaleType="fitStart"
를 주면 두개의 나뉜 이미지가 붙긴하는데 이 속성이 위아래 끝으로 정렬되어 이미지의 높이가 화면보다 낮을 경우
위아래가 어긋나게 표시됩니다.
그래서 scaleType 속성말고, 두 개의 이미지가 서로 붙게 하기 위해 왼쪽은 오른쪽으로 정렬하고 오른쪽 이미지는 왼쪽으로 정렬
하고자 하는데 속성값을 찾아봐도 통 답이 안나옵니다.
어떤 방법이 있을까요?
그럼 즐거운 하루 즐거운 코딩 되세요..^^
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:weightSum="2">
<ImageView
android:id="@+id/img_left"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_weight="1"/>
<ImageView
android:id="@+id/img_right"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_weight="1"/>
</LinearLayout>




원하시는대로 될진 모르겠지만..
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:weightSum="2" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<ImageView
android:id="@+id/img_left"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentRight="true" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<ImageView
android:id="@+id/img_right"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true" />
</RelativeLayout>
</LinearLayout>