我一直在玩 XML,试图通过改变int来排列按钮.价值,然后看看它在我的手机上的样子.我试图让 Eclipse显示在 Eclipse上的“Graphical Layout”选项卡上但没有成功.我是否需要在XML文件中添加内容
我已经在@ this链接上尝试了所有解决方案:Graphical layout missing for Layout XML Files
这是有问题的XML文件,这是我看到的屏幕截图:http://snag.gy/6H0v6.jpg
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/persona_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="5dp" > <TextView android:id="@+id/persona_marquee" android:layout_width="fill_parent" android:layout_height="wrap_content" android:ellipsize="marquee" android:focusable="true" android:gravity="center" android:marqueeRepeatLimit="marquee_forever" android:maxLines="1" android:scrollHorizontally="true" android:textColor="#f0f0f0f0" android:textSize="26sp" android:textStyle="bold" android:visibility="gone" > </TextView> <ImageView android:id="@+id/persona_img" android:layout_width="match_parent" android:layout_height="wrap_content" android:keepScreenOn="true" > </ImageView> <TextView android:id="@+id/persona_misctxt" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" > </TextView> <LinearLayout android:id="@+id/persona_scorebox" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" android:visibility="gone" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/your_score" android:textSize="16sp" android:textStyle="bold" > </TextView> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/rate_star_big_on" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/rate_star_big_on" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/rate_star_big_on" /> <ImageView android:id="@+id/persona_star4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/rate_star_big_on" android:visibility="gone" /> <ImageView android:id="@+id/persona_halfstar4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/rate_star_big_half" android:visibility="gone" /> <ImageView android:id="@+id/persona_star5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/rate_star_big_on" android:visibility="gone" /> <ImageView android:id="@+id/persona_halfstar5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/rate_star_big_half" android:visibility="gone" /> <ImageView android:id="@+id/persona_star5empty" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/rate_star_big_off" android:visibility="gone" /> </LinearLayout> <LinearLayout android:id="@+id/textbox" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="2" android:gravity="center" android:orientation="horizontal" android:visibility="gone" > <TextView android:id="@+id/persona_nametxt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" android:paddingRight="7dp" android:textSize="16sp" android:textStyle="bold" > </TextView> <TextView android:id="@+id/persona_desctxt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" android:textSize="14sp" > </TextView> </LinearLayout> <RelativeLayout android:id="@+id/persona_statbars" android:layout_width="match_parent" android:layout_height="wrap_content" android:visibility="gone" > <TextView android:id="@+id/statlabel1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginLeft="5dp" android:ellipsize="end" android:maxLines="1" android:paddingLeft="20dp" android:paddingRight="5dp" android:paddingTop="5dp" android:text="@string/statbar1" /> <ProgressBar android:id="@+id/persona_statbar1" style="?android:attr/progressBarStyleHorizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:layout_alignTop="@id/statlabel1" android:layout_margin="1dp" android:layout_toRightOf="@id/statlabel1" android:indeterminate="false" android:maxHeight="15dip" android:minHeight="15dip" android:paddingTop="5dp" android:progress="100" android:progressDrawable="@drawable/redprogress" /> <TextView android:id="@+id/statlabel2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignRight="@id/statlabel1" android:layout_below="@id/statlabel1" android:ellipsize="end" android:maxLines="1" android:paddingRight="5dp" android:paddingTop="5dp" android:text="@string/statbar2" /> <ProgressBar android:id="@+id/persona_statbar2" style="?android:attr/progressBarStyleHorizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignTop="@id/statlabel2" android:layout_below="@id/persona_statbar1" android:layout_margin="1dp" android:layout_toRightOf="@id/statlabel2" android:indeterminate="false" android:maxHeight="15dip" android:minHeight="15dip" android:paddingTop="5dp" android:progress="100" android:progressDrawable="@drawable/redprogress" /> <TextView android:id="@+id/statlabel3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignRight="@id/statlabel2" android:layout_below="@id/statlabel2" android:ellipsize="end" android:maxLines="1" android:paddingRight="5dp" android:paddingTop="5dp" android:text="@string/statbar3" /> <ProgressBar android:id="@+id/persona_statbar3" style="?android:attr/progressBarStyleHorizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignTop="@id/statlabel3" android:layout_below="@id/persona_statbar2" android:layout_margin="1dp" android:layout_toRightOf="@id/statlabel3" android:indeterminate="false" android:maxHeight="15dip" android:minHeight="15dip" android:paddingTop="5dp" android:progress="100" android:progressDrawable="@drawable/redprogress" /> </RelativeLayout> <LinearLayout android:id="@+id/progress_bar_container" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:gravity="center" android:orientation="horizontal" android:padding="16dp" android:visibility="gone" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:paddingRight="5dp" android:text="@string/lovemeter" android:textSize="20sp" > </TextView> <ProgressBar android:id="@+id/ProgressBar" style="?android:attr/progressBarStyleHorizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:indeterminate="false" android:max="100" android:maxHeight="35dip" android:minHeight="35dip" android:progress="1" android:progressDrawable="@drawable/redprogress" > </ProgressBar> </LinearLayout> <Button android:id="@+id/again_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="1dp" android:padding="10dp" android:text="@string/again" android:textColor="#f0f0f0f0" android:visibility="gone" android:layout_weight="1" > </Button> <com.hookedmediagroup.wasabi.TearRatingView android:id="@+id/wasabi_tear_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:visibility="gone" android:layout_weight="1" > </com.hookedmediagroup.wasabi.TearRatingView>请在此处查看我的问题和答案: How to get the graphical layout Window back in Eclipse for Android Application Design?
这将是您的问题的Sollution.
请享用. :))