呈现android布局时出错。宽度的未知异常错误
Layout\u cell.xml呈现android布局时出错。宽度的未知异常错误,android,Android,Layout\u cell.xml 由于非法参数异常,我在布局中遇到奇怪的错误。我真的不明白出了什么问题。请导游。使用Logcat检查时,我的宽度和高度始终为>0。此错误不会阻止编译,我可以成功生成代码。但它不允许我查看我的Layout\u cell.xml文件的设计格式 将所有uk.co.daentech.circulardemo.widgets.ProgressBarlayout\u width和layout\u height更改为固定尺寸 例如: <?xml version="1
由于非法参数异常,我在布局中遇到奇怪的错误。我真的不明白出了什么问题。请导游。使用
Logcat
检查时,我的宽度和高度始终为>0
。此错误不会阻止编译,我可以成功生成代码。但它不允许我查看我的Layout\u cell.xml
文件的设计格式 将所有uk.co.daentech.circulardemo.widgets.ProgressBar
layout\u width
和layout\u height
更改为固定尺寸
例如:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:weightSum="1">
<!-- android:background="@drawable/orangeback"-->
<TextView
android:id="@+id/main.weather_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="52sp"
tools:text="Icon"/>
<TextView
android:id="@+id/main.temperature"
android:layout_width="57dp"
android:layout_height="match_parent"
android:layout_weight="1.34"
android:gravity="center"
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="50sp"
tools:text="20" />
<uk.co.daentech.circulardemo.widgets.ProgressCircle
android:id="@+id/progress_circle"
android:layout_width="166dp"
android:layout_height="148dp"
android:layout_margin="30dp"
android:textSize="80sp"
android:textColor="#BBD452"
app:progressColor="#BBD452"
app:incompleteProgressColor="#D4D4D4"
app:strokeWidth="15dp"
/>
<uk.co.daentech.circulardemo.widgets.ProgressBar
android:id="@+id/progress_bar"
android:layout_margin="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.10"
/>
<uk.co.daentech.circulardemo.widgets.ProgressBar
android:id="@+id/progress_bar2"
android:layout_margin="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.11"
/>
<GridLayout
android:orientation="horizontal"
android:layout_width="410dp"
android:layout_height="match_parent"
android:gravity="center"
>
<uk.co.daentech.circulardemo.widgets.ProgressCircle
android:id="@+id/progress_circle2"
android:layout_width="105dp"
android:layout_height="95dp"
android:textSize="36sp"
android:textColor="@android:color/holo_orange_light"
app:progressColor="@android:color/holo_orange_light"
app:incompleteProgressColor="#D4D4D4"
app:strokeWidth="10dp"
android:layout_marginTop="90dp"
android:layout_row="0"
android:layout_column="0"
android:layout_marginLeft="45dp" />
<uk.co.daentech.circulardemo.widgets.ProgressCircle
android:id="@+id/progress_circle3"
android:layout_width="105dp"
android:layout_height="95dp"
android:textSize="36sp"
android:textColor="@android:color/holo_red_light"
app:progressColor="@android:color/holo_red_light"
app:incompleteProgressColor="#D4D4D4"
app:strokeWidth="10dp"
android:layout_row="0"
android:layout_column="2"
android:layout_marginTop="90dp"
android:elevation="0dp"
android:layout_margin="-2dp" />
<uk.co.daentech.circulardemo.widgets.ProgressCircle
android:id="@+id/progress_circle4"
android:layout_width="105dp"
android:layout_height="95dp"
android:textSize="36sp"
android:textColor="@android:color/holo_purple"
app:progressColor="@android:color/holo_purple"
app:incompleteProgressColor="#D4D4D4"
app:strokeWidth="10dp"
android:layout_marginTop="30dp"
android:layout_margin="5dp"
android:layout_row="0"
android:layout_column="1"
/>
</GridLayout>
</LinearLayout>
将所有
uk.co.daentech.circulardemo.widgets.ProgressBar
布局宽度和布局高度更改为某个恒定尺寸
例如:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:weightSum="1">
<!-- android:background="@drawable/orangeback"-->
<TextView
android:id="@+id/main.weather_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:textAlignment="center"
android:textColor="#000000"
android:textSize="52sp"
tools:text="Icon"/>
<TextView
android:id="@+id/main.temperature"
android:layout_width="57dp"
android:layout_height="match_parent"
android:layout_weight="1.34"
android:gravity="center"
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="50sp"
tools:text="20" />
<uk.co.daentech.circulardemo.widgets.ProgressCircle
android:id="@+id/progress_circle"
android:layout_width="166dp"
android:layout_height="148dp"
android:layout_margin="30dp"
android:textSize="80sp"
android:textColor="#BBD452"
app:progressColor="#BBD452"
app:incompleteProgressColor="#D4D4D4"
app:strokeWidth="15dp"
/>
<uk.co.daentech.circulardemo.widgets.ProgressBar
android:id="@+id/progress_bar"
android:layout_margin="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.10"
/>
<uk.co.daentech.circulardemo.widgets.ProgressBar
android:id="@+id/progress_bar2"
android:layout_margin="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.11"
/>
<GridLayout
android:orientation="horizontal"
android:layout_width="410dp"
android:layout_height="match_parent"
android:gravity="center"
>
<uk.co.daentech.circulardemo.widgets.ProgressCircle
android:id="@+id/progress_circle2"
android:layout_width="105dp"
android:layout_height="95dp"
android:textSize="36sp"
android:textColor="@android:color/holo_orange_light"
app:progressColor="@android:color/holo_orange_light"
app:incompleteProgressColor="#D4D4D4"
app:strokeWidth="10dp"
android:layout_marginTop="90dp"
android:layout_row="0"
android:layout_column="0"
android:layout_marginLeft="45dp" />
<uk.co.daentech.circulardemo.widgets.ProgressCircle
android:id="@+id/progress_circle3"
android:layout_width="105dp"
android:layout_height="95dp"
android:textSize="36sp"
android:textColor="@android:color/holo_red_light"
app:progressColor="@android:color/holo_red_light"
app:incompleteProgressColor="#D4D4D4"
app:strokeWidth="10dp"
android:layout_row="0"
android:layout_column="2"
android:layout_marginTop="90dp"
android:elevation="0dp"
android:layout_margin="-2dp" />
<uk.co.daentech.circulardemo.widgets.ProgressCircle
android:id="@+id/progress_circle4"
android:layout_width="105dp"
android:layout_height="95dp"
android:textSize="36sp"
android:textColor="@android:color/holo_purple"
app:progressColor="@android:color/holo_purple"
app:incompleteProgressColor="#D4D4D4"
app:strokeWidth="10dp"
android:layout_marginTop="30dp"
android:layout_margin="5dp"
android:layout_row="0"
android:layout_column="1"
/>
</GridLayout>
</LinearLayout>
Ia km在设置恒定的布局宽度和高度后仍会出现相同的错误。我注意到
<uk.co.daentech.circulardemo.widgets.ProgressBar
android:id="@+id/progress_bar"
android:layout_margin="20dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_weight="0.10"/>
android:id=“@+id/进度条”
>android:layout_margin=“20dp”
>android:layout_width=“10dp”
>android:layout_height=“30dp”
>android:layout_weight=“0.10”
> />
>
>android:id=“@+id/progress_bar2”
>android:layout_margin=“20dp”
>android:layout_width=“10dp”
>android:layout_height=“30dp”
>android:layout_weight=“0.11”
> />
消除错误
我有一个单独的代码来设计Progressbar Ia km在设置恒定的布局宽度和高度后仍会出现相同的错误。我注意到
<uk.co.daentech.circulardemo.widgets.ProgressBar
android:id="@+id/progress_bar"
android:layout_margin="20dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_weight="0.10"/>
android:id=“@+id/进度条”
>android:layout_margin=“20dp”
>android:layout_width=“10dp”
>android:layout_height=“30dp”
>android:layout_weight=“0.10”
> />
>
>android:id=“@+id/progress_bar2”
>android:layout_margin=“20dp”
>android:layout_width=“10dp”
>android:layout_height=“30dp”
>android:layout_weight=“0.11”
> />
消除错误
我有一个单独的代码来设计Progressbar Ia km在设置恒定的布局宽度和高度后仍会出现相同的错误。我观察到removingIa km在设置恒定的布局宽度和高度后仍然会得到相同的错误。我注意到