0

在我的活动中,我有八个EditText小部件。因为他们太多了,用户填写之后,活动看起来拥挤而无序。我只想EditText用一行来制作,当EditText点击它时,它会变得更大——它包含的所有单词的高度和宽度。我怎么做?这是我的单一代码EditText

<EditText
    android:id="@+id/EDITtitle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:ellipsize="end"
    android:ems="10"
    android:lines="1" >
</EditText>
4

3 回答 3

0

here you have choose only one line it means that it will get text only for one line son edit text will be only of one line and it will not grow after one line

于 2013-06-20T11:47:26.060 回答
0

尝试这个

public void onBtnClicked(View v) 
{
    EditText current_text_box = (EditText) v;
    Intent intent = new Intent(ObservationActivity.this,    TexteditorActivity.class);
    intent.putExtra("start_text", current_text_box.getText().toString());
    intent.putExtra("start_position", current_text_box.getSelectionStart());
    startActivityForResult(intent, v.getId()); // the getid() identifies the

}

这是当您单击 EditText 调用新活动该活动包含大尺寸的 EditText 当您保存它时,它将回到旧阶段...

于 2013-06-20T12:07:01.047 回答
0

尝试这个

EditText current_text_box = (EditText) findViewById(R.id.current_eidttext);
current_text_box.setOnClickListener(new View.OnClickListener) {
        current_text_box.setTextScaleX(size);
    current_text_box.setTextSize(size);

}
于 2013-06-20T12:12:10.777 回答