First, Description:
A recent project needs to develop a table-like interface to display and configure parameters, Android does not have direct-like control support, I use the ListView layout EditText and TextView to implement, where TextView is used to display the parameter specifier, EditText is used to display parameter values, with a custom alertdialog pop-up display, as shown in.
Second, the question:
Developed APK software, the mobile phone control is OK, but on the TV can not be manipulated, the specific performance is:
Third, the settlement:
1 Fix the problem that the ListView cannot click By setting focus to stop on the ListView. Methods are as follows
2 on questions 2 and 3, itself and 1 are mutually exclusive, for example, I set the focus manually to EditText, at this time can not respond to click the ListView, More deadly, the logic is completely chaotic, for example, I press the DOWN ARROW, the cursor stays in the first column, and the focus has already followed the remote to move to the The next column, at this time, press OK, the modified or the cursor stays in the column of data, 3 is shown. Finally, after repeated attempts, the following solutions are resolved.
Workaround : Enter the following code in the ListView Setonitemselectedlistener onitemselected and Onnothingselected respectively
3 about question 4, can not call input method problem, the online introduction of 00 Total, most of them are useless, there is only one way is OK, the original link in this, the solution is as follows:
Iv. Description:
1 about android:descendantfocusability, there are three attribute values, described in the following table, detailed can refer to this post description.
|
Beforedescendants |
ViewGroup takes precedence over its subclass control and gets to focus |
|
Afterdescendants |
ViewGroup gets focus only if its subclass control does not need to get focus |
|
Blocksdescendants |
ViewGroup overrides the subclass control and gets the focus directly |
EditText Focus issue in "Android" ListView