2017-07-29 3 views
0

Android O preview 4, Nexus 6P.Problème de rupture de ligne TextView sur Android O

Image 1 has text filled in text view's width exactly

Image 2 has the same text but add one more letter 'g'

Alors pourquoi dans l'image 2 plus une lettre 'g' tirer vers le bas 'tuvwxyzabcdef' ensemble, ils sont censés être dans la ligne supérieure.

Est-ce un bug dans Android O?

Activité I utilisé:

public class MainActivity extends AppCompatActivity { 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_main); 
     TextView v = (TextView)findViewById(R.id.text_view); 
    } 
} 

fichier XML R.layout.activity_main:

<?xml version="1.0" encoding="utf-8"?> 
<android.support.constraint.ConstraintLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.example.androidodemo.MainActivity"> 
    <TextView 
     android:id="@+id/text_view" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:text="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefg" 
     app:layout_constraintBottom_toBottomOf="parent" 
     app:layout_constraintLeft_toLeftOf="parent" 
     app:layout_constraintRight_toRightOf="parent" 
     app:layout_constraintTop_toTopOf="parent" /> 

</android.support.constraint.ConstraintLayout> 
+1

Postez le xml pour cette –

+0

code affiché @AbedElazizShehadeh – andrava

Répondre