gpt4 book ai didi

android - TextInputLayout float 标签显示缓慢

转载 作者:行者123 更新时间:2023-12-05 07:45:51 25 4
gpt4 key购买 nike

我已经应用了 android TextInputLayout,它工作正常。但是当出现 Text Input Layout 时,编辑文本变得非常慢。以及我已经更改了提示颜色,但它不起作用。

布局 xml:

 <android.support.design.widget.TextInputLayout
android:id="@+id/register_input_layout_password"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLength="15"
android:lines="1"
android:id="@+id/Register_fragment_passwo_field"
android:hint="Password"
android:layout_gravity="center_vertical"
android:paddingLeft="35dp"
android:textColor="#ffffff"
android:textColorHint="@android:color/white"
android:layout_marginTop="5dp" />
</android.support.design.widget.TextInputLayout>

依赖:编译'com.android.support:design:23.0.1'

最佳答案

   <!-- if You Can Change Color of TextInputLayout Like this-->
<style name="TextLabel" parent="TextAppearance.AppCompat">
<!-- Hint color and label color in FALSE state -->
<item name="android:textColorHint">@color/Color Name</item>
<item name="android:textSize">20sp</item>
<!-- Label color in TRUE state and bar color FALSE and TRUE State -->
<item name="colorAccent">@color/Color Name</item>
<item name="colorControlNormal">@color/Color Name</item>
<item name="colorControlActivated">@color/Color Name</item>
</style>

如果您更改动画时间,则像这样自定义 EditText:

public class FloatingEditText extends FrameLayout{

animation = new AnimatorSet();
ObjectAnimator move =
ObjectAnimator.ofFloat(mHintTextView, "translationY", mHintTextView.getHeight() / 8, 0);
ObjectAnimator fade;
if (mEditText.isFocused()) {
fade = ObjectAnimator.ofFloat(mHintTextView, "alpha", 0, 1);
} else {
fade = ObjectAnimator.ofFloat(mHintTextView, "alpha", 0, 0.50f);
}
animation.playTogether(move, fade);
}

关于android - TextInputLayout float 标签显示缓慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41177588/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com