私は、次のようなレイアウトがあります。SwipeRefreshLayoutは - 前の兄弟へのクリックを渡す
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.v4.widget.SwipeRefreshLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</RelativeLayout>
活動に:
のstrings.xmlでTextView tv = (TextView) findViewById(R.id.message);
tv.setText(Html.fromHtml(getResources().getString(R.string.message));
が
<string name="message"><![CDATA[Visit <a href="http://example.com">this site</a>]]></string>
クリックでURLへのすべてのタッチがSwipeRefreshLayoutによってインターセプトされるため、TextViewは機能しません。
TextViewのURLのCliksに対してSwipeRefreshLayoutを透明にすることはできますが、同時にスワイプを有効にすることはできますか?
の間にいくつかの余裕をもってしてみてください:https://developer.android.com/ reference/android/view/ViewGroup.html#attr_android:descendantFocusability – AndroidRuntimeException
助けになりません。レイアウト階層に注意してください。 – Alexey