如下面的屏幕截图所示,使用a TextInputLayout换行时似乎会自动添加左边距EditText.
EditText在布局XML中没有添加填充,但是当渲染视图时,似乎在左边有填充EditText.比较TextView下面的时候你可以看到这个TextInputLayout.
如何禁用此左侧填充?
谢谢!
android android-layout material-design android-textinputlayout
在构建项目时,我们不断在 CircleCI 上遇到以下异常。从 CircleCI CLI 运行作业时,一切运行良好。有没有人为此找到修复/解决方案?
Compilation with Kotlin compile daemon was not successful
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.EOFException
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:236)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
at com.sun.proxy.$Proxy104.compile(Unknown Source)
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.incrementalCompilationWithDaemon(GradleKotlinCompilerWork.kt:284)
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.compileWithDaemon(GradleKotlinCompilerWork.kt:198)
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.compileWithDaemonOrFallbackImpl(GradleKotlinCompilerWork.kt:141)
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.run(GradleKotlinCompilerWork.kt:118)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.runCompilerAsync(GradleKotlinCompilerRunner.kt:158)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.runCompilerAsync(GradleKotlinCompilerRunner.kt:153)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.runJvmCompilerAsync(GradleKotlinCompilerRunner.kt:92)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompilerAsync$kotlin_gradle_plugin(Tasks.kt:447)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompilerAsync$kotlin_gradle_plugin(Tasks.kt:355)
at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.executeImpl(Tasks.kt:312)
at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute(Tasks.kt:284)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskInputsTaskAction.doExecute(IncrementalTaskInputsTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
at org.gradle.api.internal.project.taskfactory.AbstractIncrementalTaskAction.execute(AbstractIncrementalTaskAction.java:25)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:404)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
at …Run Code Online (Sandbox Code Playgroud) flutter_web 文档说 dart:svg 已移植,但是您如何将其与 flutter 资产/小部件系统一起使用?
我有一个布局,用于更新状态栏的背景颜色colorPrimaryDark.
当布局的根布局为a时CoordinatorLayout,这很有用,但当我将其切换到LinearLayout状态栏时,背景不再更新.
布局源和屏幕截图粘贴在下面.还列出了正常工作的布局示例.
谢谢!
layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".churches.ChurchesActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<FrameLayout
android:id="@+id/contentFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.PopupOverlay" …Run Code Online (Sandbox Code Playgroud) android android-layout android-linearlayout android-notification-bar android-coordinatorlayout
在Android Studio中开发的Flutter项目的合法.gitignore是什么?
到目前为止,这是我所拥有的,但是当我在Android Studio中打开该项目时,无法启用Dart支持或浏览该项目。
#flutter specific
.flutter-plugins
.DS_Store
.dart_tool/
.packages
.pub/
build/
android/app/google-services.json
.idea/
android/key.properties
pubspec.lock
doc/api/
#ios specific
ios/.generated/
ios/Podfile*
ios/Flutter/Debug.xcconfig
ios/Flutter/Release.xcconfig
ios/Runner.xcworkspace/contents.xcworkspacedata
#android specific
android/app/google-services.json
android/key.properties
# User-specific
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
.idea/modules.xml
.idea/*.iml
.idea/modules
*.iml
# File-based project format
*.iws
# IntelliJ
out/
Run Code Online (Sandbox Code Playgroud) 我在我的 Flutter Web 应用程序上使用 Firebase 身份验证,但会话在刷新期间没有保留。
这是我正在使用的包。
https://pub.dev/packages/firebase
这就是我使用 Firebase 进行身份验证的方式
static Future<User> handleSignInEmail(String email, String password) async {
await init();
final UserCredential userCredential =
await auth().signInWithEmailAndPassword(email.trim(), password);
assert(userCredential.user != null);
assert(await userCredential.user.getIdToken() != null);
final User currentUser = await userCredential.user;
assert(userCredential.user.uid == currentUser.uid);
print('signInEmail succeeded: $userCredential.user');
return userCredential.user;
}
Run Code Online (Sandbox Code Playgroud)
如果我刷新页面并调用以下方法,则返回的用户为空:
static Future<User> getFirebaseUser() async {
await init();
return await auth().currentUser;
}
Run Code Online (Sandbox Code Playgroud)
使用 Flutter Mobile 的类似实现按预期工作。我在 Flutter Web 实现中遗漏了什么?
我正在开发 flutter web 应用程序并尝试从互联网上获取一些数据我正在使用 package:http/http.dart 并尝试这样做:
await http.get(url);
Run Code Online (Sandbox Code Playgroud)
但我收到了这个错误:
不支持的操作:Platform._version
daz@daz:/rom/source/public/checkout_example$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel master, v1.16.2-pre.41, on Linux, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[?] Chrome - develop for the web
[?] Linux toolchain - develop for Linux desktop
[?] Android Studio (version 3.6)
[!] IntelliJ IDEA …Run Code Online (Sandbox Code Playgroud) 我有一个使用非常简单的自定义布局的DatePickerFragment.布局占用较小设备(HTC One m7)上的整个警报对话框,但不在Nexus 6上.有人知道为什么DatePicker不占用Nexus 6警报对话框的整个宽度或从哪里开始排除故障?谢谢!
Nexus 6(注意日期标题不会填满整个警报对话框)
HTC One m7
dialog_date.xml
<?xml version="1.0" encoding="utf-8"?>
<DatePicker xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dialog_date_date_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:calendarViewShown="false">
</DatePicker>
Run Code Online (Sandbox Code Playgroud)
DatePickerFragment的onCreateDialog()
public Dialog onCreateDialog(Bundle savedInstanceState) {
Date date = (Date) getArguments().getSerializable(ARG_DATE);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
View v = LayoutInflater.from(getActivity())
.inflate(R.layout.dialog_date, null);
mDatePicker = (DatePicker)
v.findViewById(R.id.dialog_date_date_picker);
mDatePicker.init(year, month, day, null);
return new AlertDialog.Builder(getActivity())
.setView(v)
// .setTitle(R.string.date_picker_title)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int …Run Code Online (Sandbox Code Playgroud) 我使用Image.network为列表中的每个项目加载图像,使用以下代码:
Image getEventImageWidget(AustinFeedsMeEvent event) {
return event.photoUrl.isNotEmpty ?
Image.network(
event.photoUrl,
width: 77.0,
height: 77.0,
) : Image.asset(
'assets/ic_logo.png',
width: 77.0,
height: 77.0,
);
}
Run Code Online (Sandbox Code Playgroud)
当我向上和向下滚动时,列表有时会在加载图像时挂起.有没有办法在背景线程上加载图像?我该怎么做才能帮助修复滚动性能?
我正在创建一个读卡器集成,该集成使用 Android 服务作为集成的一部分。标准 Android 实现包括 android 服务定义AndroidManifest.xml
<service
android:name="com.anywherecommerce.android.sdk.services.CardReaderConnectionService"
android:stopWithTask="false" />
Run Code Online (Sandbox Code Playgroud)
如何在 Flutter 插件中定义它,以便将服务定义添加到使用它的应用程序的 AndroidManifest 中?我是否只需将其作为库的一部分包含在内,然后由用户在其应用程序中注册该服务AndroidManifest.xml?