当占位符可见时,如何让清除按钮显示在UITextField上?以下情况有效,但只有在选中并输入文本后才可见。
清除按钮(输入文字时)
class Node {
public:
int num;
long long weight;
long long tree_weight;
vector<Node *> children;
Node(int n, long long w) : num(n), weight(w) {}
};
long long tree_weight(Node * root, int n)
{
vector<bool> visited(n);
long long result=root->weight;
queue<Node *> q;
visited[root->num - 1] =true;
Node * blah = root->children[0];
}
如何在编辑和清空时显示清除按钮?