Note: I have since edited this question's summary as I believe the focus must shift from Android APIs to Facebook itself.
Ever since my devices updated to Facebook v42, or since Facebook updated it's Graph API to v2.4 (7th August), my app has failed to login. My Samsung S6 (API 22) failed initially, and 3 days later when my HTC (API 21) updated the Facebook app it too failed to login when it had been successful until then. …
包括在我activity_main.xml中的DrawerLayout是一个CoordinatorLayout叫content_layout.xml.这CoordinatorLayout是我的AppBarLayout包含a Toolbar,然后是LinearLayout一个片段的内容.
当包含a的片段RecyclerView向上滚动时,工具栏将成功退出.向下滚动以使工具栏返回时出现问题.在滚动工具栏的完整高度之前,工具栏不会出现,因此在其位置留下难看的白色框,如图所示.
工具栏http://i59.tinypic.com/33xil5d.png
content_layout.xml
<android.support.design.widget.CoordinatorLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container_frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.AppBarLayout>
<!-- The main content view for fragments-->
<LinearLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)
工具栏通过MainActivity's 初始化onCreate():
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Run Code Online (Sandbox Code Playgroud)
我将不胜感激任何解决这个问题的建议.谢谢.
我想检测一下我是否EditText包含smilie(表情符号).但我不知道如何检测它们.
我有一个EditText有4行(min = 4;> 4个滚动).该EditText被嵌入TextInputLayout.为此显示的提示似乎是垂直居中.我自然喜欢在第一线的开头.
重要编辑:测试TextInputLayout不允许有效定位提示.问题在于此.任何有关如何解决它的见解表示赞赏.
<android.support.design.widget.TextInputLayout
android:id="@+id/text_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusableInTouchMode="true">
<EditText
android:id="@+id/status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:fadeScrollbars="false"
android:gravity="left"
android:hint="What's going on?"
android:inputType="textMultiLine"
android:lines="4"
android:minLines="4"
android:scrollbarStyle="outsideInset"
android:scrollbarThumbVertical="@drawable/custom_scrollbar_style"
android:scrollbars="vertical"
android:textColorHint="@color/black_semi_transparent" />
<TextView
android:id="@+id/text_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:text="140"
android:textColor="@color/black_semi_transparent" />
</android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)
我使用 aTabView来表示三个选项卡。在 iOS 14 中,这处理得很好,但 iOS 13 导致底部栏是灰色的,这是用于导航的选项卡栏。我怎样才能删除这个酒吧?
请记住,这是TabView一个TabView. 外部TabView的栏显示在底部,带有五个选项卡;TabView我根本不想显示的内部栏。
下面的代码代表内部TabView.
import SwiftUI
struct DashboardView: View {
@State private var pageIndex = 1
var body: some View {
VStack {
DashboardTopBar(index: $pageIndex) // A custom selected tab indicator
if #available(iOS 14.0, *) {
TabView(selection: $pageIndex) {
RehabView().tag(0)
PerformanceView().tag(1)
RecoveryView().tag(2)
}
.tabViewStyle(PageTabViewStyle())
.indexViewStyle(PageIndexViewStyle(backgroundDisplayMode: .always))
} else {
TabView(selection: $pageIndex) {
RehabView().tag(0)
PerformanceView().tag(1)
RecoveryView().tag(2)
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
下图左侧为 …
我有一个 Firestore 数据库和一个用户。在用户通过 REST 请求登录后,我能够为他们检索 ID 令牌。
我将使用 ID 令牌请求从数据库读取/写入。
当安全规则打开时(任何人都可以读/写),我可以通过 Python 请求读取和写入 Firestore:
headers = {
'Content-Type': 'application/json',
}
url = 'https://firestore.googleapis.com/v1beta1/projects/[PROJECT_NAME]/databases/(default)/documents/[COLLECTION]/[DOCUMENT]'
r = requests.get(url, headers=headers)
Run Code Online (Sandbox Code Playgroud)
写法类似,略去。
尝试按照这些文档为实时数据库附加 ID 令牌会给出错误消息""Invalid JSON payload received. Unknown name \"auth\""...
我的问题是如何通过 REST 为 Firestore 授权用户 ID 令牌?
我想阻止用户输入当前时间之前的时间.我使用before提供的方法检查有效时间Date.如何防止对话框在此有效性检查中接受无效时间?
我在初始化所选时间(作为a Date)时省略了多余的代码.
final Calendar mcurrentTime = Calendar.getInstance();
final int hour = mcurrentTime.get(Calendar.HOUR_OF_DAY);
final int minute = mcurrentTime.get(Calendar.MINUTE);
final TimePickerDialog mTimePicker;
mTimePicker = new TimePickerDialog(MainActivity.this, new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
//PSEUDO: Date selectedDateTime init here
if (selectedDateTime.before(mcurrentTime.getTime())) {
// prevent user from selecting time
}
}
}, hour, minute, true);//true = 24 hour time
mTimePicker.setTitle("Select Time");
mTimePicker.show();
Run Code Online (Sandbox Code Playgroud)