###前提・実現したいこと
androidstudio初心者です。
androidstudioで自作Viewを用いた描画アプリを作成しています。そこで自分で作成したViewをlayout側main.xmlで定義しようとしているのですが、エラーが出てしまいます。エミュレータでアプリを起動しようとしても強制終了してしまいます。
よろしくお願いします。
###発生している問題・エラーメッセージ
Element RelativeLayout doesn't have required attribute android:layout_height Element RelativeLayout doesn't have required attribute android:layout_width
###該当のソースコード
java
1<?xml version="1.0" encoding="utf-8"?> 2<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"> 3 xmlns:android="http://schemas.android.com/apk/res/android" 4 xmlns:app="http://schemas.android.com/apk/res-auto" 5 xmlns:tools="http://schemas.android.com/tools" 6 7 <jp.ac.gifu_u.edu.t3033180.paint0427.MyView 8 android:id="@+id/View01" 9 android:layout_width="wrap_content" 10 android:layout_height="wrap_content" /> 11 <![CDATA[ 12 13 android:paddingBottom="@dimen/activity_vertical_margin" 14 android:paddingLeft="@dimen/activity_horizontal_margin" 15 android:paddingRight="@dimen/activity_horizontal_margin" 16 android:paddingTop="@dimen/activity_vertical_margin" 17 app:layout_behavior="@string/appbar_scrolling_view_behavior" 18 tools:context="jp.ac.gifu_u.edu.t3033180.paint0427.MainActivity" 19 tools:showIn="@layout/activity_main"> 20 21 ]]> 22</RelativeLayout>
###補足情報(言語/FW/ツール等のバージョンなど)
AndroidStudio1.5.1です。
よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/05/10 05:25