【问题标题】:how to remove click anywhere in fragment layout goes to main activity button clicked on that click如何删除片段布局中任意位置的单击转到单击该单击的主活动按钮
【发布时间】:2019-04-14 09:55:30
【问题描述】:

当我点击片段布局中的任意位置时,点击点击的主活动按钮,如何删除片段中的这种透明度。

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_blank, container, false);
    return view;
}

【问题讨论】:

  • 您的问题不清楚?你能详细说明一下吗?
  • 够了吗?
  • 我没想到。

标签: android click fragment


【解决方案1】:

我之前遇到过这个问题,尝试将这行添加到父布局fragment_blank

例如

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#fff"
    android:clickable="true"
    android:focusable="true">

    <!--other views-->

</LinearLayout>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-05
    • 2011-09-20
    相关资源
    最近更新 更多