无法在edittext android上输入文字

时间:2016-08-15 10:19:27

标签: java android xml

我的android项目有问题。我在ScrollView中使用了EditText,但我无法在其上输入文字?它在我在java代码中将数据放入spinner之前正常运行。但是现在,即使我评论java代码,它仍然无法正常工作。你能帮助我吗?这是我的代码。

#include <iostream>
#include <string>       // Used for std::getline()

// Don't use 'namespace std' - it's bad practice

int main()
{
    int arrSize = 3;    // Now we know the size of the array, we won't exceed arr[2]
    std::string arr[3] = { "X", "XX", "XXX" };
    std::string input;

    std::cout << "Enter input: ";   // A propmt would be useful
    std::getline(std::cin, input);  // Much better way to get input

    for (unsigned int i = 0; i < arrSize; ++i)  // Now we won't exceed the array size
    {
        if (input == arr[i])    // Compare the input string (not character) with each string in arr[]
            std::cout << "Your input is at position " << i << std::endl;
        else
            std::cout << "Your input is not at position " << i << std::endl;
    }

    std::cin.ignore();      // Wait for user to press enter before exiting
    return 0;
}

文件.java

 var db = new DataContext();
        var CurrentCurrency = "RUR";
        DbSet<Entry> set = null;
        switch (CurrentCurrency) {
            case "RUR":
                set = db.RurEntries;
            break;
            case "EUR":
                set = db.EurEntries;
            break;
            case "USD":
                set = db.UsdEntries;
            break;
            default:
                throw new Exception();
        }
        var res = set.ToList();

感谢您的支持!

1 个答案:

答案 0 :(得分:0)

我建议更改EditText的

android:layout_height="match_parent"

android:layout_height="wrap_content"