Android Activity没有重绘

时间:2014-09-01 16:05:33

标签: android relativelayout

我有一个简单的android活动的问题,它只是相对布局。问题是,如果我写了一些东西,如果我删除它,光标仍然是如此写入的文本。

example 1 example 2

我不知道如何修复它,并且如果它与设备有关,则没有任何其他设备可以尝试。 (Nexus 7 2012,Android 4.4.4)

布局:          

<!-- options header -->            
<TextView 
    android:id="@+id/Options_text"
    android:text="@string/options"
    android:layout_width="fill_parent"
    android:layout_height="70dp"    
    android:textStyle="bold"
    android:textSize="48sp"
 />  

<!-- IP address row -->     
<TextView 
    android:id="@+id/IP_address_text" 
    android:layout_below="@id/Options_text"
    android:layout_width="150dp"
    android:layout_height="50dp"
    android:layout_alignParentLeft="true"
    android:paddingTop="10dp"
    android:paddingLeft="10dp"
    android:textSize="24sp"
    android:text="@string/ip_addr"
 />

<EditText
    android:id="@+id/IP_address"
    android:layout_width="300dp"
    android:layout_height="50dp"
    android:layout_below="@+id/Options_text"
    android:layout_marginLeft="60dp"
    android:layout_toRightOf="@+id/IP_address_text"
    android:inputType="phone"
    android:paddingTop="10dp"
    android:width="300dp"
    android:maxLength="15" />

<!-- port row --> 
<TextView 
    android:id="@+id/Port_text"
    android:layout_height="wrap_content"  
    android:text="@string/port" 
    android:paddingTop="10dp"
    android:paddingLeft="10dp"
    android:textSize="24sp"
    android:layout_below="@+id/IP_address_text"
    android:layout_width="150dp"/>  
<EditText
    android:id="@+id/Port"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"  
    android:inputType="phone" 
    android:layout_below="@+id/IP_address_text"
    android:layout_toRightOf="@+id/Port_text"
    android:layout_marginLeft="60dp"
    android:textSize="20sp"
    android:width="100dp"/>
</RelativeLayout>

班级:

public class Options extends Activity {

    public void fullscreen(){
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        fullscreen();
        setContentView(R.layout.options);
    }

}

1 个答案:

答案 0 :(得分:0)

我强烈建议在其他设备上测试此应用程序。根据您提供的内容,不会出现任何错误。如果您无法获得其他设备来测试您的应用程序,您可以随时set up an AVD.这将允许您在&#34;新&#34;上使用您的应用程序。没有任何先前可能导致冲突的更改的设备。

使用多个设备进行测试始终是一个好计划。它将允许您发现问题。甚至是你可能没有找到的解决方案。

相关问题