小编sud*_*007的帖子

如何在新的android设计库中使用TextInputLayout

最近谷歌推出了新的Android设计库,其中介绍了如何使用TextInputLayout字段来启用EditText的浮动提示功能.

这里没有太多的指导.

这个页面说

您现在可以将其包装在TextInputLayout中

但不知道,因为智能预测(Ctrl + SPACE)不会预测TextInputLayout的任何属性.所以我的问题是:

我们如何掌握这个组件底层的EditText?

我们如何从EditText获取数据?

android android-design-library

45
推荐指数
2
解决办法
5万
查看次数

"路径python3(来自--python = python3)不存在"错误

我添加python36/Scripts了环境变量的路径文件和python36.但它仍然显示以下错误

Command = C:\Users\Sonalika\dev\trydjango1-11>virtualenv -p python3

我收到错误:

路径python3(来自--python = python3)不存在

django virtualenv python-3.x

11
推荐指数
2
解决办法
4万
查看次数

DisplayMessageActivity无法解析为类型构建第一个Android应用程序

嗨,我刚开始研究developer.android.com上的第一个Android应用程序.

好,开始与我学习很多错误根源及其解决方案从SO,但我一直在试图找出这种说法 "DisplayMessageActivity不能被解析为一个类型",而我们必须设定按钮的onclick功能的意图.它显示了这行错误的代码行是:

Intent intent = new Intent (this, DisplayMessageActivity.class);
Run Code Online (Sandbox Code Playgroud)

这是java文件:

MainActivity.java

}
/**called when the user clicks the send button*/
public void sendMessage(View view) {
    Intent intent = new Intent (this, DisplayMessageActivity.class);
    EditText editText = (EditText) findViewById (R.id.edit_message);
    String message = editText.getText().toString();
    intent.putExtra(EXTRA_MESSAGE, message);
    startActivity (intent);
}
}
Run Code Online (Sandbox Code Playgroud)

我尝试了很多找哪一类,我需要现在进口和搜查,但无济于事.可能我是一个初学者是我错过这里.

java android

10
推荐指数
2
解决办法
2万
查看次数

无法在Glide 4.4上使用滑行变换

我搜索了所有地方,但自从Glide发布4.4版以来。我再也找不到一种应用RoundedCornersTransformation的方法。我正在使用滑行变换,即使在他们的Github论坛上也没有正确的解决方案。

先前:

GlideApp.with(context)
.load(url)
.transforms(new CenterCrop(), new RoundedCorners(radius))
.into(imageView);
Run Code Online (Sandbox Code Playgroud)

然后必须通过更新来调用它,如下所示:

Glide.with(context)
   .load(url)
   .apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(radius)))
   .into(imageView);
Run Code Online (Sandbox Code Playgroud)

但是使用Glide 4.4,我面临的问题是:

1:根本不应用转换。

2:如果我尝试使用.transformsAPI,似乎不再可用!

如果有人可以帮助,请回复。如果找到我的答复,我会发表!

android image android-glide

3
推荐指数
2
解决办法
6368
查看次数

Android:如何进行垂直合并?

我想做一个Android应用程序。此应用程序需要 7 行 7 列,如 7*7 矩阵。以下是问题:

1) 如何将单元格 1*1 与 2*1 或 1*1,2*1 和 3*1 垂直合并?2)我也可以动态制作吗?3)我应该使用哪种布局?

先感谢您。

这是 screen.xml

<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/grid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnCount="8"
android:orientation="horizontal"
android:rowCount="9" >


<Space
    android:layout_column="0"
    android:layout_columnSpan="1"
    android:layout_gravity="fill"
    android:layout_row="0" 
    android:tag=""/>

<TextView
    android:id="@+id/Monday"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_column="1"
    android:layout_gravity="center"
    android:layout_row="0"
    android:text="Monday"
    android:textSize="10dp" 
    android:tag="Monday"
    />



<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_column="2"
    android:layout_gravity="center"
    android:layout_row="0"
    android:text="Tuesday"
    android:textSize="10dp" 
    android:tag="Tuesday"/>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_column="3"
    android:layout_gravity="center"
    android:layout_row="0"
    android:text="Wednesd."
    android:textSize="10dp" 
    android:tag="Wednesday"/>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_column="4"
    android:layout_gravity="center"
    android:layout_row="0"
    android:text="Thursday"
    android:textSize="10dp" 
    android:tag="Thursday"/>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_column="5"
    android:layout_gravity="center"
    android:layout_row="0"
    android:text="Friday" …
Run Code Online (Sandbox Code Playgroud)

android android-layout android-linearlayout android-fragments android-activity

2
推荐指数
1
解决办法
4394
查看次数

setOnEditorActionListener不适用于Android Lollipop

我一直在尝试这个 IME_ACTION

 //Listening to the keyboard action
    mSearchEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == R.id.ime_search || actionId == EditorInfo.IME_ACTION_SEARCH) {

                performSearch();
                return true;
            }
            return false;
        }
    });
Run Code Online (Sandbox Code Playgroud)

但似乎它对Lollipop设备一点都不起作用.

这是XML代码 - 我完全相信我这样做是正确的.

 <org.mapunity.widget.FloatingEditText
        android:id="@+id/fragment_search_edit_text"
        android:hint="Enter a Text to Search"
        android:layout_marginTop="@dimen/spacing_small"
        android:layout_marginBottom="@dimen/spacing_small"
        android:singleLine="true"
        app:floating_edit_text_highlighted_color="@color/color_primary"
        android:layout_marginLeft="@dimen/spacing_normal"
        android:imeActionLabel="@string/action_search"
        android:imeOptions="actionSearch"
        android:imeActionId="@+id/ime_search"
        android:inputType="text"
        android:layout_marginRight="@dimen/spacing_normal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
        <requestFocus></requestFocus>
        </org.mapunity.widget.FloatingEditText>
Run Code Online (Sandbox Code Playgroud)

请提供一个输入:

知道有很多类似的问题,但我的是Lollipop,即Android 5.0+.

android keyboard-events android-5.0-lollipop

1
推荐指数
1
解决办法
1221
查看次数