I am begineer in Android Development. I am making a XML layout but the property of textSize not showing also the code which generated automatically when we type not generating like if we type match then studio will show match_parent that is not generating. How to solve this?
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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"// this line is showing in black
android:id="@ id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="?attr/actionBarSize">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@ id/nav_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_menu" />
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
also when I tried to drag and drop it again not showing attributes of textview like textstyle, textsize etc.
I am trying to increase my text size but the property in attributes not showing it.
CodePudding user response:
You seem to be having project and/or IDE errors. Have you tried syncing with gradle or Invalidating cache and restarting Android Studio?
CodePudding user response:
It seem to occur error, and TextView if in ConstraintLayout must be have app:layout_constraintBottom_toBottomOf property
so I suggest below code
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:id="@ id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="?attr/actionBarSize">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@ id/nav_view"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:menu="@menu/bottom_nav_menu"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>