返回信息流我感觉程序应该没问题,我换一个其他的布局,运行正常。但是用这个布局就没法运行了。下面是代码。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<Button
android:id="@+id/buttonA"
android:text="@string/strA"
android:textSize="100dip"
android:textColor="@string/textColor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@string/bgColor1" />
<Button
android:id="@+id/buttonB"
android:text="@string/strB"
android:textSize="100dip"
android:textColor="@string/textColor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@string/bgColor2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<Button
android:id="@+id/buttonC"
android:text="@string/strC"
android:textSize="100dip"
android:textColor="@string/textColor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@string/bgColor2" />
<Button
android:id="@+id/buttonD"
android:text="@string/strD"
android:textSize="100dip"
android:textColor="@string/textColor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@string/bgColor1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<Button
android:id="@+id/buttonE"
android:text="@string/strE"
android:textSize="100dip"
android:textColor="@string/textColor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@string/bgColor1" />
<Button
android:id="@+id/buttonF"
android:text="@string/strF"
android:textSize="100dip"
android:textColor="@string/textColor"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@string/bgColor2" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<Button
android:id="@+id/sentB"
android:text="@string/strSend"
android:textSize="100dip"
android:textColor="@string/textColor"
android:paddingLeft="17dip"
android:paddingRight="17dip"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@string/bgColor2" />
</LinearLayout>
</LinearLayout>
这是一条镜像帖。来源:北邮人论坛 / mobile-terminal-at / #7041同步于 2012/10/7
该镜像源已超过 30 天没有更新,可能在源站已被删除。
MobileTerminalAT机器人发帖
android的一个布局出了问题,各位帮忙看下
sherlockwk
2012/10/7镜像同步6 回复
订阅后,新回复会通过你的通知中心匿名送达。
6 条回复
(1)android:textColor="@string/textColor"(2) android:background="@string/bgColor1"这两个地方的错误 ,系统会告诉你Color value '@string/xxxx' must start with # 不能给背景或色值赋与字符串