私は簡単な挨拶友人のアプリを作ろうとしています。アンドロイドStudioで3.0.1Androidスタジオでこのレイアウトが動作しないのはなぜですか?
activity_main.xmlのための私のXMLコードは
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="hk.ust.cse.comp107x.greetfriend.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="250dp"
android:text="Hello World!" />
</RelativeLayout>
で、主な活動クラスの私のコードは、私はまだ持っていない
package hk.ust.cse.comp107x.greetfriend;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
ですボタンとテキストボックスを入れて完成しましたが、私は問題に直面しています。
私はエミュレータ/仮想デバイスに私のアプリのプレビューが表示されたら、私はAndroidの...書かれたアクションバーオーバーレイレイアウト との電話The Screenshot内の灰色の画面を取得します。
ここで何か問題がありますか?
私はXMLを使い慣れていないので、あまりにも多くの単語を取得することはありません... ありがとうございます。
清潔で再構築 – Zoe