2013-10-07 30 views
0

初學Android開發人員。我使用Eclipse來編寫和設計應用程序。Android - 文字環繞設計師和模擬器,但不在設備上

突然,TextViews停止在我的Android實體設備上打包文本。警報對話框不再包裝。包裝在設計器和模擬器中正確工作。

它們在我上次測試它時正確包裝在設備上。既然這樣,我只添加了一個有幾個按鈕的新活動。我不相信我的主菜單的活動,這是下面改變任何東西。

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<RelativeLayout 
android:id="@+id/textViewRedeem" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:paddingBottom="@dimen/activity_vertical_margin" 
android:paddingLeft="@dimen/activity_horizontal_margin" 
android:paddingRight="@dimen/activity_horizontal_margin" 
android:paddingTop="@dimen/activity_vertical_margin" 
tools:context=".ActivityMainMenu" > 

<Button 
    android:id="@+id/buttonQuickStart" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentTop="true" 
    android:onClick="handleQuickStart" 
    android:text="@string/buttonQuickStart" /> 
<Button 
    android:id="@+id/buttonLoad" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignLeft="@+id/textViewLoad" 
    android:layout_alignRight="@+id/buttonQuickStart" 
    android:layout_below="@+id/textViewNew" 
    android:layout_marginTop="18dp" 
    android:onClick="handleLoad" 
    android:text="@string/buttonLoad" /> 

<Button 
    android:id="@+id/buttonRedeemCode" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignLeft="@+id/textViewLoad" 
    android:layout_below="@+id/textViewLoad" 
    android:layout_marginTop="14dp" 
    android:onClick="handleRedeem" 
    android:text="@string/buttonRedeemCode" /> 

<Button 
    android:id="@+id/buttonNew" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignLeft="@+id/textViewQuickStart" 
    android:layout_alignRight="@+id/buttonQuickStart" 
    android:layout_below="@+id/textViewQuickStart" 
    android:layout_marginTop="18dp" 
    android:onClick="handleNew" 
    android:text="@string/buttonNew" /> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignLeft="@+id/buttonRedeemCode" 
    android:layout_below="@+id/buttonRedeemCode" 
    android:text="@string/defineRedeem" 
    android:textAppearance="?android:attr/textAppearanceMedium" 
    android:singleLine="false"/> 
<TextView 
    android:id="@+id/textViewQuickStart" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignLeft="@+id/buttonQuickStart" 
    android:layout_below="@+id/buttonQuickStart" 
    android:text="@string/defineQuickStart" 
    android:textAppearance="?android:attr/textAppearanceMedium" 
    android:singleLine="false"/> 
<TextView android:id="@+id/textViewNew" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignLeft="@+id/buttonNew" 
    android:layout_below="@+id/buttonNew" 
    android:text="@string/defineNew" 
    android:textAppearance="?android:attr/textAppearanceMedium" 
    android:singleLine="false"/> 
<TextView 
    android:id="@+id/textViewLoad" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignLeft="@+id/textViewNew" 
    android:layout_below="@+id/buttonLoad" 
    android:text="@string/defineLoad" 
    android:textAppearance="?android:attr/textAppearanceMedium" 
    android:singleLine="false" /> 

的AVD我使用的是3.2" HVGA滑蓋Android 4.3的實際設備I測試應用程序是一款帶有Android 2.3.6和3.65「屏幕的三星S7500L。

回答

0
// try this 
<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:tools="http://schemas.android.com/tools" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:paddingBottom="@dimen/activity_vertical_margin" 
      android:paddingLeft="@dimen/activity_horizontal_margin" 
      android:paddingRight="@dimen/activity_horizontal_margin" 
      android:paddingTop="@dimen/activity_vertical_margin" 
      tools:context=".ActivityMainMenu" > 

    <LinearLayout 
      android:id="@+id/textViewRedeem" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:gravity="center" 
      android:layout_marginTop="5dp" 
      android:orientation="vertical"> 

     <Button 
       android:id="@+id/buttonQuickStart" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:onClick="handleQuickStart" 
       android:text="@string/buttonQuickStart" /> 

     <TextView 
       android:id="@+id/textViewQuickStart" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="@string/defineQuickStart" 
       android:textAppearance="?android:attr/textAppearanceMedium"/> 

     <Button 
       android:id="@+id/buttonNew" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="18dp" 
       android:onClick="handleNew" 
       android:text="@string/buttonNew" /> 

     <TextView android:id="@+id/textViewNew" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="@string/defineNew" 
        android:textAppearance="?android:attr/textAppearanceMedium"/> 

     <Button 
       android:id="@+id/buttonLoad" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="18dp" 
       android:onClick="handleLoad" 
       android:text="@string/buttonLoad" /> 

     <TextView 
       android:id="@+id/textViewLoad" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="@string/defineLoad" 
       android:textAppearance="?android:attr/textAppearanceMedium"/> 

     <Button 
       android:id="@+id/buttonRedeemCode" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="14dp" 
       android:onClick="handleRedeem" 
       android:text="@string/buttonRedeemCode" /> 

     <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="@string/defineRedeem" 
       android:textAppearance="?android:attr/textAppearanceMedium"/> 
    </LinearLayout> 

</ScrollView> 
相關問題