我正在使用TextInputLayoutAndroid设计库中的新功能,
当EditText集中,一切都还好,我可以看到上面的提示EditText:

但是当EditText失去焦点时,提示完全消失了:

我希望提示会返回到EditText,我还缺少什么?
下面的xml代码。
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="20dp">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Try me!"/>
</android.support.design.widget.TextInputLayout>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:hint="Try me 2"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud) 有没有办法在 Android.Support.Design.Widget.FloatingActionButton 中显示“子菜单”?
非常感谢!
android submenu material-design floating-action-button android-design-library
是否可以同时显示 2、3 或 4 个 Snackbars(堆叠)?我现在正在使用官方的 Google Design 和 AppCompat 支持库,并且会派上用场(我使用 Snackbars 来显示应用程序的状态 - 网络状态、电源状态、训练模式等,这些都是重要的信息,有自己的颜色,我不能将它们连接成一个)。
我现在的小吃店是持久的,没有行动,我不打算改变这一点。
我正在尝试 android 上的新材料设计组件,例如底部应用栏,但我发现每个 MDC 都存在于 android 设计支持库中,但也存在于另一个被调用com.google.android.material的库中,并且代码几乎相同(在设计库中,代码与另一个不同),那么这两个库之间有什么区别?
android android-studio android-design-library androiddesignsupport
我正在尝试在我的主要项目中实现底部模式表。我在一个演示项目中成功地做到了。但是当我将相同的结构应用于我的主项目时,应用程序崩溃并出现以下错误:
android.view.InflateException:二进制 XML 文件第 40 行:无法膨胀行为子类 android.support.design.widget.BottomSheetBehavior 由:java.lang.RuntimeException:无法膨胀行为子类 android.support.design.widget.BottomSheetBehavior
AndroidRuntime:引起:java.lang.ClassNotFoundException:在路径上找不到类“android.support.design.widget.BottomSheetBehavior”:DexPathList[[zip file“/data/app/com.example...... ..]]]
我尝试了之前app:layout_behavior="@string/bottom_sheet_behavior"在我的 xml 中所述的内容,但没有奏效。
在演示项目中,底部工作表在嵌套父视图中正常工作。
我的主要项目依赖项是 -(添加到 app build.gradle)
def lifecycle_version = "2.1.0-alpha02"
def room_version = "2.1.0-alpha04"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'me.relex:circleindicator:2.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
annotationProcessor "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
Run Code Online (Sandbox Code Playgroud) android android-design-library androiddesignsupport bottom-sheet
我想在我的应用程序中使用新的设计支持库,从API 21开始.我想使用Theme.Material样式,但它仅适用于Theme.AppCompat样式.当我使用Theme.Material时,android会返回此错误:
错误膨胀类android.support.design.widget.textinputlayout"
我该如何解决?
先感谢您
Ps:抱歉我的英语不好,我是法国人.
更新: 这是我的代码
styles.xml
<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">
<item name="android:colorPrimary">@color/primary</item>
<item name="android:colorPrimaryDark">@color/primary_dark</item>
<item name="android:colorAccent">@color/accent</item>
<item name="android:colorControlNormal">@color/control_normal</item>
<item name="android:textColorHint">@color/silver</item>
</style>
Run Code Online (Sandbox Code Playgroud)
activity.xml
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="username"
android:id="@+id/editText1" />
</android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)
的build.gradle
dependencies {
//compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':facebook')
compile('com.twitter.sdk.android:twitter:1.1.0@aar') {
transitive = true;
exclude module: 'gson'
}
compile 'com.google.android.gms:play-services-plus:7.5.0'
compile 'com.google.android.gms:play-services-identity:7.5.0'
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:support-v13:22.0.0'
compile 'com.android.support:cardview-v7:22.0.0'
compile 'com.soundcloud.android:android-crop:0.9.10@aar'
compile files('libs/volley.jar')
compile files('libs/gson-2.3.1.jar')
compile files('libs/httpclient-4.3.3.jar')
compile files('libs/httpclient-cache-4.3.3.jar')
compile files('libs/httpcore-4.3.2.jar')
compile files('libs/httpmime-4.3.3.jar')
compile files('libs/commons-lang3-3.3.2.jar')
compile …Run Code Online (Sandbox Code Playgroud) android android-5.0-lollipop material-theme android-design-library androiddesignsupport
CollapsingToolbarLayout | 滚动和布局问题2
我一直在努力与Android Support Design Library成功实施的CoordinatorLayout引起Toolbar和TabLayout滚动时滚动拿出来看.这非常有效,所以我想我会尝试新的运气CollapsingToolbarLayout.
在单独的活动中,我一直在执行问题CollapsingToolbarLayout.正如他们所说,我很接近,但没有雪茄.
我想使用2个不同的片段
ImageView)我自己构建了这个布局的一个例子,但经过多次尝试后无法使它工作.最后,我发现了[在这里输入图像描述] [5]并修改它以达到我现在的目的
注意:我不知道这些是否是由1件事(多米诺骨牌效应)引起的,或者这些是否是个体的.另外,我查看了很多相关问题,但似乎没有任何问题.
Scrollable Content 显示在标题图像上方Scrollable Content 没有固定在底部 Header Image滚动Scrollable Content它会滚动Header Image看似随机的:
Just right 并遵循手指的速度(完美)Too fast并Header Image通过移动我的手指1行文本的高度来动画屏幕此外Scroll down,上述2种效果与第3种效果同时发生
Instant或Near instant"动画"显示Header Image全宽编辑:下面的问题在另一个问题中被问到!! 上面有一个简单的修复
在CollapsingToolbarLayout不允许我展开Toolbar …
xml android material-design android-design-library android-collapsingtoolbarlayout
如何在CollapsingToolbar Layout的标题上获得淡化的稀松布?
我已经使用app:expandedTitleTextAppearance属性成功设置了文本大小和颜色,但无法弄清楚如何为文本提供背景.
我知道这是可能的,因为我可以看到WhatsApp在其Group Info屏幕中完成了它.
我使用了Android设计支持库,并使用tablayout,fragment和viewpager在我的Android应用程序中实现了选项卡.标签滑动工作完美.但是当我添加更多标签(比如7)时,这些标签会减小它们的宽度并自行调整.如何一次仅显示3个选项卡,并在用户从第3个选项卡滑动到第4个选项卡时显示接下来的三个选项卡?
java android android-fragments android-viewpager android-design-library
我用a 作为图标制作了TextInputEditTexta ,然后添加了..此操作已删除或隐藏了我的代码,这是我的代码:PasswordFieldDrawableLeftPasswordToggleEnabled(true)DrawableLeft
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleContentDescription="Show Password"
app:passwordToggleEnabled="true"
app:hintEnabled="false"
android:id="@+id/signupPasswordlayout"
app:passwordToggleTint="@color/edittexttint">
<android.support.design.widget.TextInputEditText
android:hint="Password"
android:id="@+id/signupPassword"
android:drawableLeft="@drawable/ic_password"
android:drawablePadding="10dp"
android:inputType="textPassword"
android:drawableTint="@color/edittexttint"
android:textSize="15sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)
因此,是否可以同时显示(PasswordToggle和DrawableLeft?)谢谢!
java android android-edittext android-studio android-design-library
android ×10
java ×2
android-collapsingtoolbarlayout ×1
bottom-sheet ×1
hint ×1
submenu ×1
xml ×1