inflate a button using xml to style
问题 Trying to inflate a Button code: LinearLayout ll = (LinearLayout)this.getLayoutInflater().inflate(R.layout.assets, null); Button btn = (Button)ll.getChildAt(0); R.layout.assets (assets.xml): <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:id="@+id/main" android:layout_height="match_parent" android:weightSum="1" android:padding="50px"> <Button android:text="Button" android:layout_width=