현실 세계에서는 아래 그림과 같은 컨트롤 패널 레이아웃이 FrameLayout (단편 컨테이너)과 (앱이 태블릿에서 실행 중인지 여부에 따라)지도와 함께 표시되며, 색상은 colorpicker에 의해 '색상'버튼. (주의 :지도와 제어판의 배경이 다릅니다.)부모 무시 배경을 보시겠습니까?
colorpicker에서 돌아 오면 연결된지도 입자와 버튼 배경이 새 색상으로 업데이트됩니다.
버튼의 색상이지도와 정확히 일치한다는 아이디어가 있습니다.
그리고 물론 그렇지 않습니다! (선택된 색상이 255 알파가 아닌 한).
'예상 된 동작'이라고 알고 있지만, 자식 배경색이 올바르게 렌더링되도록 부모 배경 (단추 자식에만 해당)을 제거하는 영리한 (또는 '해킹') 트릭이 있습니까?
예 제어판 레이아웃 및 코드
<LinearLayout android:id="@+id/settingsLL"
android:orientation="vertical">
<LinearLayout android:id="@+id/oneOfMany"
android:orientation="horizontal">
<TextView style="@style/wptedit_title" android:text="[some title]" />
<Button style="@style/wptedit_color" android:id="@+id/colorBtn" />
</LinearLayout>
</LinearLayout>
// Control panel background
settingsLL.setBackgroundColor(0xFFD5FFDD);
// Faint red tint gives desired map background not reflected by button
colorBtn.setBackgroundColor(0x04FF0000);