Set style on TableRow in Android
问题 Using the Android SDK, there doesn't seem to be any way to set the style on a table row. I want to do the equivalent of: <TableRow style='@style/TableRow_classic' > in code. I would like something like: TableRow row = new TableRow(this); row.setStyle(R.style.TableRow_classic); Does anyone know how to find this? 回答1: The best solution I've found to accomplish this is to create a "partial" layout representing the table row, with a style defined: <?xml version="1.0" encoding="utf-8"?> <TableRow