다른 표 행이 있으며 각 표에는 클릭 할 수없고 선택할 수없는 정보 텍스트가 포함되어 있습니다. 하지만 에뮬레이터에서이 코드를 실행하면 텍스트를 항상 클릭 할 수 있습니다.레이아웃 XML에서 TextView의 텍스트를 unclickable로 만들려면 어떻게해야합니까?
즉, 텍스트 블록을 클릭하면 색상이 어두운 회색으로 바뀝니다. 나는 그것을 바꾸기를 원하지 않는다. 나는 아무것도하지 않기를 바란다.
분명히 어두운 회색을 텍스트 색상으로 설정하여 사용자가 아무 것도 클릭하지 않는 것을 볼 수는 있지만 원하는 것은 아닙니다.
예제에서 볼 수있는 것과는 다른 속성을 이미 시도했지만 아무 것도 도움이되지 않았습니다. 또한, 실제로 TableRow 또는 TableRow 내부의 TextView를 클릭 할 수 없게 설정해야합니까? 당신이 attritbutes을 둘 필요가
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
>
<ScrollView
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal">
<TableLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:stretchColumns="*"
android:clickable="false">
<TableRow
android:layout_width="fill_parent"
android:background="#777777"
android:clickable="false">
<TextView
android:id="@+id/heading"
android:text="This is the cool heading"
android:textColor="#FFFFFF"
android:layout_width="fill_parent"
android:textSize="14sp"
android:paddingLeft="5sp"
android:paddingRight="5sp"
android:paddingTop="2sp"
android:paddingBottom="2sp"
android:textStyle="bold"
android:clickable="false"
/>
</TableRow>
<TableRow
android:clickable="false"
android:linksClickable="false"
android:focusable="false"
android:focusableInTouchMode="false">
<TextView
android:text="This is example text. It should not be clickable, but it is."
android:textSize="14sp"
android:paddingLeft="5sp"
android:paddingRight="5sp"
android:paddingTop="2sp"
android:paddingBottom="2sp"
android:scrollHorizontally="false"
android:inputType="textMultiLine"
android:linksClickable="false"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_width="0sp"
/>
</TableRow>
</TableLayout>
</ScrollView>
</RelativeLayout>
전체 tablerow가 어두운 회색으로 변경되거나 텍스트 내부의 텍스트 만 darkgrey로 변경됩니까? –
텍스트 만 회색으로 바뀝니다. – Bevor