Android開発をしているものです。
初めて、imageButtonの使用を試みたのですが、
エラーが出ます。
エラーはこれです。
![イメージ説明]WIDTH:600
XMLは、
lang
1<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" 3 android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" 4 android:paddingRight="@dimen/activity_horizontal_margin" 5 android:paddingTop="@dimen/activity_vertical_margin" 6 android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"> 7 8 <ImageButton 9 android:layout_width="wrap_content" 10 android:layout_height="wrap_content" 11 android:id="@+id/imageButton_1" 12 android:src="@drawable/start" 13 android:layout_centerVertical="true" 14 android:layout_alignParentLeft="true" 15 android:layout_alignParentStart="true" /> 16 17 <ImageButton 18 android:layout_width="wrap_content" 19 android:layout_height="wrap_content" 20 android:id="@+id/imageButton_2" 21 android:src="@drawable/ranking" 22 android:layout_alignTop="@+id/imageButton_1" 23 android:layout_alignParentRight="true" 24 android:layout_alignParentEnd="true" 25 android:layout_toRightOf="@+id/imageButton_1" 26 android:layout_toEndOf="@+id/imageButton_1" /> 27 28 <ImageButton 29 android:layout_width="wrap_content" 30 android:layout_height="wrap_content" 31 android:id="@+id/imageButton_3" 32 android:src="@drawable/asobikata" 33 android:layout_alignParentRight="true" 34 android:layout_alignParentEnd="true" 35 android:layout_toRightOf="@+id/imageButton_1" 36 android:layout_toEndOf="@+id/imageButton_1" 37 android:layout_alignBottom="@+id/imageButton_1" 38 android:layout_below="@+id/imageButton_2" /> 39 40 <ImageButton 41 android:layout_width="wrap_content" 42 android:layout_height="wrap_content" 43 android:id="@+id/imageButton_4" 44 android:src="@drawable/hp" 45 android:layout_below="@+id/imageButton_3" 46 android:layout_centerHorizontal="true" /> 47 48 <ImageButton 49 android:layout_width="wrap_content" 50 android:layout_height="wrap_content" 51 android:id="@+id/imageButton_5" 52 android:src="@drawable/osusume" 53 android:layout_below="@+id/imageButton_4" 54 android:layout_centerHorizontal="true" /> 55 56 <ImageView 57 android:layout_width="wrap_content" 58 android:layout_height="wrap_content" 59 android:id="@+id/imageView" 60 android:src="@drawable/title" 61 android:layout_above="@+id/imageButton_1" 62 android:layout_centerHorizontal="true" 63 android:layout_marginBottom="28dp" /> 64 65 <net.nend.android.NendAdView 66 android:id="@+id/nend1" 67 android:layout_width="wrap_content" 68 android:layout_height="wrap_content" 69 NendApiKey="ab70483b843db0cf5076cee36b7cb57808403525" 70 NendSpotId="335960" 71 android:layout_alignParentTop="true" 72 android:layout_centerHorizontal="true" /> 73 74</RelativeLayout> 75
です。
Javaは、
lang
1package com.ora_nge.pushplus; 2 3import android.os.Bundle; 4import android.support.v7.app.ActionBarActivity; 5 6 7public class MainActivity extends ActionBarActivity { 8 9 @Override 10 protected void onCreate(Bundle savedInstanceState) { 11 super.onCreate(savedInstanceState); 12 setContentView(R.layout.activity_main); 13 14 } 15} 16
これだけです。
何が原因でしょうか。
回答1件
あなたの回答
tips
プレビュー