无法运行应用程序,“处理过多的输出” - Android Studio

问题描述 投票:2回答:1

下面是xml代码段。没有对MainActivity.java进行任何更改。我已经开始制作一个计算器并完成了设计部分,但是当我尝试运行这个应用程序时(在各种实际设备上),Android Studio的logcat显示 - “处理输出太多”并强制关闭设备(实际设备) ,而不是模拟器)。我曾使用shape.xml和strings.xml文件。没有其他的!

MainActivity.xml文件

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    tools:context=".MainActivity"
    android:id="@+id/asdjk"
    android:background="#ffc8c8c8">


    <Button
        android:layout_width="@string/w"
        android:layout_height="@string/h"
        android:id="@+id/clearButton"
        android:background="@drawable/shape"
        android:clickable="true"
        android:text="@string/clearButtonString"
        android:textColor="#FFC85D00"
        android:textSize="30sp"
          
        android:layout_above="@+id/sevenButton"
        android:layout_toLeftOf="@+id/fiveButton"
        android:layout_toStartOf="@+id/fiveButton"
         />
  
   <!-- lots of other buttons -->
  
  </RelativeLayout>

Shape.xml文件

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="#ffffffff"/>
    <!--
    <corners android:radius="10dp"/>
    -->
    <stroke
        android:width="1px"
        android:color="#ffc8c8c8" />
    </shape>
android xml android-studio android-logcat
1个回答
0
投票

android:layout_height维度或关键字。需要。组的高度,作为维值(或维度资源)或关键字(“fill_parent”或“wrap_content”)。请参阅下面的有效值。

来自:http://developer.android.com/guide/topics/resources/layout-resource.html

© www.soinside.com 2019 - 2024. All rights reserved.