엊그제 막 안드로이드 스튜디오 깔고... 코틀린으로 tabLayout 예제해보려하는데..
tabItem 만 추가하면 view 가 안나오고 아래와 같은 에러가 뜹니다..
No speakable text present
This item may not have a label readable by screen readers.
Learn more at https://support.google.com/accessibility/android/answer/7158690
구글링해보고, Stackflow 검색해보고 해도 저와 같은 증상은 없는것 같더라구요
targetSdk 32, 33 으로 시도해보았습니다, 해결되진 않았습니다.
제작 작성한건 아래 캡쳐화면이 전부입니다.
<com.google.android.material.tabs.TabLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/tabs">
<com.google.android.material.tabs.TabItem
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="1"/>
</com.google.android.material.tabs.TabLayout>
↑ 위 소스코드(material 라이브러리의 tabLayout) 는 에러 남 ㅠㅠ
아래 디펜던시를 추가하니깐 material tablayout이 아닌 다른 tabLayout으로 열리는건 되는데
// 아래 내용 넣어주닌 탭 레이아웃 되는건 확인
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
전 material 라이브러리의 tabLayout을 가지고 오고자 합니다(추후에 혹시 문제가 있을까봐...)
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/tabs">
<android.support.design.widget.TabItem
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="1"/>
<android.support.design.widget.TabItem
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="2"/>
<android.support.design.widget.TabItem
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="3"/>↑
android.support.design.widget.TabLayout
↑ 이걸로 TabLayout 가져오면 화면 현시는 잘 됨
혹시 원인을 아시는 분 계시면 지식을 나눠주시면 감사하겠습니다!