업데이트내 Hello World Android 활동이 전체 화면에 걸쳐 나타나지 않는 이유는 무엇입니까?
다음 스타일을 추가하고 내 응용 프로그램을 설정 한 후, 나는 그것이 전체 화면 그릴 입수했습니다 : 내 첫 안드로이드 응용 프로그램을 개발하는 동안
<resources>
<style name="app_theme" parent="android:Theme.NoTitleBar">
<item name="android:windowBackground">@color/green</item>
</style>
</resources>
을 나는 내 애플 리케이션 것을 깨달았다 '뷰는 전체 화면으로 확장되지 않으며 다운로드 한 다른 샘플 프로젝트는 그렇지 않습니다. 이를 테스트하기 위해 기본 액티비티 클래스를 만들고 TextView
의 배경을 녹색으로 설정하여 얼마나 많은 액티비티가 있는지 확인합니다. 이 말은 어리석은 질문이라면 용서해주십시오. 여기
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Hello World, StackOverflow"
android:background="#00FF00"
/>
</LinearLayout>
과 : 여기
public class HomeActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
레이아웃 파일 (/res/layout/main.xml
)입니다 : 여기 이 전체 HomeActivity의 자료 : 여기
는 스크린 샷입니다 e에있는 다른 앱의 스크린 샷입니다. mulator 전체 창에 걸쳐, 잘 작동 :편집
을 지금으로 내 XML 파일을 편집 :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#00FF00"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Hello World, StackOverflow"
/>
</LinearLayout>
그리고 청소 및 구축, 실행하고있어 똑같은 견해. , 변화를 요구하지 않기 때문에 2
편집 나는 "수직"방향 라인을 제거했다.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.blah.blah.myCrap"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application android:label="@string/app_name" >
<activity android:name="HomeActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
추가 내 매니페스트에 다음과 같은 또 <application>
<supports-screens android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true" />
잘못된 크기 미만 :
여기 내 AndroidManifest를합니다.
선형 레이아웃의 배경색을 설정하십시오.그렇게하면 잘리는 TextView인지 또는 LinearLayout인지 확인할 수 있습니다. – Gophermofur
@Gophermofur가 TextView에서 bg를 제거하고 LinearLayout에 추가하여 정리하고 빌드하고 실행하면 같은 결과보기 :-(. –
manifest.xml을 게시 할 수 있습니까? – Gophermofur