2 개의 이미지가 있습니다 : bg_Image
,box_image
나는 bg_Image
배경 으로 사용하고 싶습니다 .
Android RelativeLayout을 사용했지만 배경으로 설정하면 너무 많이 확장됩니다.
원래 bg_Image
크기 를 유지하고 싶습니다 . RelativeLayout src
을 bg_Image
.
또 다른 한가지는이 box_image
의 자식bg_Image
애니메이션을 사용 box_image
하여 부모 크기에 상대적으로 이동하고 싶기 때문에
그래서 나는 그들이 부모-자녀 관계에 있기를 바랍니다.
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator">
<translate
android:fromXDelta="-100%p"
android:toXDelta="0%"
android:duration="600">
</translate>
</set>
어떻게 할 수 있습니까?
콘텐츠를 래핑하고 배경을 설정하는 것보다 상대적인 레이아웃 높이와 너비를 설정합니다.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="your background image">
</Relativelayout>
또는 상대적 레이아웃에 고정 높이와 너비를 제공합니다.
도움이 되길 바랍니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다