У меня возникли проблемы с отображением текста в текстовом виде. Я хочу создать приложение для чата/текстового стиля. Кроме того, как бы у меня была граница вокруг поля текста, чтобы она выглядела хорошо. Спасибо! и я прошу прощения за мои проблемы.Как отобразить введенный текст в текстовом виде Android
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="horizontal">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="400dp"
android:text="" />
<EditText android:id="@+id/edit_message"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/edit_message"
android:layout_gravity="bottom" />
<Button
android:id="@+id/button_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="sendMessage"
android:text="@string/button_send"
android:layout_gravity="bottom"/>
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
Button button = (Button)findViewById(R.id.button_send);
};
Я хочу иметь то, что пользователь отображается после того, как он/она нажимает на кнопку Отправить. –