나는 다음과 같은 간단한 레이아웃ScrollView에서 배경색을 어떻게 설정할 수 있습니까?
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="@+id/answerMainFrame"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/background"
android:isScrollContainer="true"
android:onClick="toAnswer" >
<ImageView
android:id="@+id/answer_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:contentDescription="@string/question_img_cd" />
<TextView
android:id="@+id/answer"
style="@style/Question"
android:layout_below="@id/answer_img" />
</RelativeLayout>
</ScrollView>
하지만 때로는 이미지 뷰와 텍스트 뷰의 크기에 따라, 그것은 화면의 높이를 기입하지 않습니다에게 있습니다. 괜찮아. 화면의 나머지 부분을 검정색 대신 흰색으로 바꾸기 만하면됩니다.
흰 바탕에 흰색으로 설정 한 android:background="@color/background"
을 시도했지만 동일한 결과를 얻었습니다.
Relativelayout에 android:layout_height="wrap_content"
설정을 시도했지만 경고가 표시됩니다.
어떻게해야합니까?
감사합니다.
정말 고마워요 @thisMayhem 좋아해요. 그것은 매력처럼 작용했습니다. 그것은 분명한 대답으로 보였다. 나는 이미 그걸 시도했다고 생각 했어. – eskalera
@eskalera 붙어있을 때 눈이 더 뜨거워지면 항상 도움이됩니다. 다행이었습니다. –