2012-12-25 3 views
1

드로어 블을 두 개의 드로어 블로 구성하려면 어떻게해야합니까? 하나는 y 축에서 반복하고 다른 하나는 오른쪽에서 끝내시겠습니까?Android : 오른쪽에서 왼쪽 타일로 된 드로어 블

<bitmap xmlns:android="http://schemas.android.com/apk/res/android" 
    android:src="@drawable/logo_pattern_file" 
    android:tileMode="repeat" 
    android:antialias="true" 
    android:dither="false" 
    android:filter="false"> 
</bitmap> 

을 그리고 그 옆은 "끝 부분"로 이미지 뷰를 의미합니다 : 내 응용 프로그램에서

나는 이런 식으로 사용합니다. 문제는 타일링 부분이 양식을 왼쪽에서 오른쪽으로 그리고 "작물"을 올바른 장소가 아닌 전체 로고를 어지럽히는 것입니다. (여기서, 새로운 사용자가 이미지를 게시 할 수 없습니다 이미지에 대한 링크입니다 : http://i.imgur.com/HLqTx.jpg)

: 여기

내가 얻고 무엇

가 어떻게 그것을 올바른 방법으로해야한다?

답변

0

Rotated pattern

그냥 같이, rotate 태그로 중첩하여 반복되는 비트 맵 (왼쪽에서 오른쪽 측면 반대의 경우도 마찬가지)를 회전하여이를 수행 할 수있다 :

<?xml version="1.0" encoding="utf-8"?> 
<rotate xmlns:android="http://schemas.android.com/apk/res/android" 
    android:fromDegrees="180" 
    android:pivotX="50%" 
    android:pivotY="50%" > 

    <bitmap 
     android:src="@drawable/core" 
     android:tileMode="repeat" /> 

</rotate> 

레이아웃이 될 수있다 이 같은 sth :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    tools:context=".MainActivity" > 

    <LinearLayout 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:background="@drawable/repeat_core" /> 

    <ImageView 
     android:layout_width="95px" 
     android:layout_height="match_parent" 
     android:src="@drawable/end" /> 

</LinearLayout>