我有一个活动,其中包括一个片段.该片段包含Recycler View.我想让它在网格中显示游戏数据.我需要它向下滚动(游戏的每一轮都是一行)但也需要水平,因为我需要5到10列.当id在回收器视图中使用参数android:scrollbars ="vertical | horizontal"时,它只向下滚动并使其列非常小.即使我将其设置为水平也会发生这种情况.
代码:活动
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.sb.matt.doppelkopf.activities.GameActivity">
<fragment
android:id="@+id/fragment_game"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.sb.matt.doppelkopf.fragments.game_fragment"
tools:layout="@layout/fragment_game">
</fragment>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
碎片
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.sb.matt.doppelkopf.fragments.game_fragment">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView_gameData"
android:scrollbars="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
Recycler视图中项目的视图
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="400dp"
android:layout_height="200dp">
<TextView
android:layout_width="400dp"
android:layout_height="200dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Test"
android:id="@+id/txt_inhalt"
android:layout_centerVertical="true"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
片段代码
package com.sb.matt.doppelkopf.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View; …
Run Code Online (Sandbox Code Playgroud) 今天我收到这样的邮件,根据这个我不能RECEIVE_SMS READ_SMS
在我的应用程序中使用了.在我的应用程序中,我使用自动读取OTP.这有什么解决方案吗?
您好Google Play开发者,
10月,我们宣布了对权限政策的更新,该政策将限制允许哪些应用请求通话记录和短信权限.此政策会影响您的一个或多个应用.
只有已选择作为用户默认应用程序拨打电话或短信的应用程序,或其核心功能被批准用于其中一个例外用例的应用程序,才能请求访问"呼叫日志"或"短信"权限.
需要采取的行动
下面,我们列出了您的目录中不符合权限请求要求的应用程序.请从应用清单中删除任何不允许或未使用的权限(在下面指定),迁移到替代实施(例如,对于大多数OTP验证情况的SMS Retriever API),或评估您的应用是否有资格获得例外.
下一步
请仔细阅读权限政策和Play控制台帮助中心文章,该文章介绍了使用呼叫日志或短信权限的预期用途,例外,无效用途和替代实施选项.
更新您的应用或提交权限声明表.
选项1)如果您的应用不需要访问"呼叫记录"或"短信"权限:通过从应用清单中删除指定的权限或在2019年1月9日之前迁移到可用的替代实施,对您的应用进行适当的更改.
选项2)如果您的应用程序是默认处理程序或您认为您的应用程序有资格获得例外:请通过权限声明表单提交请求.您无需为了提交表单而实施APK更改.在2019年1月9日之前收到的声明表格可能有资格获得更多时间进行更改以使其应用程序符合规定.如果您最近提交了权限声明表,我们正在审核您的信息,并将回复您的申请.
确保您的应用符合所有其他开发者计划政策,以防止您的应用被删除.
或者,您可以选择取消发布该应用.
我们的开发人员计划政策旨在为用户提供安全可靠的体验,同时为开发人员提供成功所需的工具.这就是为什么我们会删除违反我们政策的应用.如果重复或严重违反我们的政策,我们也可能会终止您的开发者帐户和任何相关的开发者帐户.
我们感谢您愿意与我们合作,因为我们会进行这些改进以更好地保护用户.
受影响的应用
受影响的应用和权限列在下面,最多20个; 如果您有其他应用,请确保它们也符合权限政策.