ProgramingTip

기본 레이아웃 배경은 무엇입니까

bestdevel 2020. 12. 9. 21:33
반응형

기본 레이아웃 배경은 무엇입니까


텍스트가있는 HTML 파일을로드하는 WebView가 있습니다. 문제는 html 내부와 외부 색상이 동일하지 않다는 것입니다. 다음은 스크린 샷입니다.

WebView를 사용 활동

HTML 파일은 다음과 가변됩니다.

<html dir="rtl">
<head>
    <title>About</title>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>

    <body bgcolor="#FFFFFF">
        <p>This is a Testpp</p>
        <p>See the problem.</p>
         <p>last test:</p>
    </body>
</html>

(제거하면 bgcolor="#FFFFFF"색상이 그대로 유지됨) 감사합니다!


밝은 테마의 기본 배경색은 #EEEEEE입니다.

거의 흰색이지만 완전하게.

그것은 나를 위해 일했습니다. 당신을 위해 일하기를 바랍니다.

업데이트 : 새 버전에서는 #FAFAFA를 사용할 수 있습니다.


다음을 참조하여 테마의 기본 배경색을 사용할 수 있습니다.

?android:colorBackground

배경을 변경하려는 경우 (실제로 수행하려는 작업 인 경우) :

styles.xml에서

<style name = "MyDefaultStyle" parent = "@android:style/Theme">
    <item name = "android:windowBackground">@drawable/default_drawable_bg</item>
</style>

그리고 당신의 매니페스트에서

<application
    android:name="MyApp"
    android:theme="@style/MyDefaultStyle" >

매니페스트로 이동

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/MyMaterialTheme.NoActionBar">

테마는 MyMaterialTheme.NoActionBar입니다.

res-> values-> styles로 이동하십시오. 편집기에서 열기를 클릭하십시오.

배경색을 보려면 팔레트를 클릭하십시오.

이것이 당신의 배경색입니다.

그래서 저에게 링크는 #FFFAFAFA입니다.

제안 된 색상 #EEEEEE 또는 #FAFAFA를 입력하면 일부 휴대폰에서는 작동하고 다른 휴대폰에서는 꺼져 있었기 때문에 착오를 통해 발견했습니다.


기본 색상은 검정색입니다.

스타일을 사용하는 경우 "values ​​/ styles.xml"로 이동하면 문제를 해결하는 방법이 있습니다. 이제 bg 색상을 확인할 수 있습니다. 테마 및 스타일 정보 : http://developer.android.com/guide/topics/ui/themes.html

편집하다 :

레이아웃 배경색 변경 -Android 레이아웃 요소의 배경색 설정

편집 2 :

styles.xml에서 @android : style / Theme.Light이면 bg 색상은 흰색입니다.


밝은 테마의 기본 배경색은 # e6FFFFFF입니다.

참고 URL : https://stackoverflow.com/questions/14507370/what-is-the-default-layout-background

반응형