Я сталкиваюсь с этой странной проблемой, я создал textview
в activity_main.xml
и установил текст как: android:text="Oh my god"
Но независимо от того, какой текст я поместил, вывод на экране приложения будет:
Привет из C ++
Фактически, положение текста изменяется в соответствии с моими настройками, но текст всегда остается, к сожалению, неизменным.Я попытался удалить и снова добавить textview
, но без изменений.
![enter image description here](https://i.stack.imgur.com/lrbnH.png)
MainActivity.java:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Example of a call to a native method
TextView tv = (TextView) findViewById(R.id.sample_text);
tv.setText(stringFromJNI());
}
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/sample_text"
android:layout_width="147dp"
android:layout_height="76dp"
android:layout_marginStart="248dp"
android:layout_marginTop="16dp"
android:text="Oh my god"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
PS: У какого-то парня такая же проблема , но на него еще не ответили.