1
이것은 처음부터 조금씩 돌아 다니며 조금 실험 해본 결과 목록의 배경색을 배경색으로 변경하려고합니다. .Android First App, 지정된 색상 목록에서 배경색 변경
android:background="@color/all_white"
가 이상적으로는 (한 OnCreate의 색상을 변경하려면)에 :
현재는
<color name="all_white">#FFFFFF</color>
이 main.xml에 사용된다 strings.xml의에 규정 된 흰색 배경을로드 내 선택의 색. 나는 setBackgroundDrawable을 시도했지만 작동하지 않는 것 같은가요? 안드로이드에서
public class TestActivity extends Activity
{
double dimValPercent = 100;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
SetDimLevel(dimValPercent);
SetBackground();
return;
}
public void SetBackground()
{
getWindow().setBackgroundDrawable(new ColorDrawable
(color.all_blue));
return;
}
void SetDimLevel(double dimVal)
{
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = (float) (dimVal/ 255.0);
getWindow().setAttributes(lp);
return;
}
}