据我所知,这是Snackbar的原始布局:
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<TextView
android:id="@+id/snackbar_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
...
android:ellipsize="end"/>
<Button
android:id="@+id/snackbar_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
...
android:textColor="?attr/colorAccent"
style="?attr/borderlessButtonStyle"/>
</merge>
是否可以覆盖原始的Android布局,例如这个?
答案 0 :(得分:0)
您无法覆盖,但可以更改原始布局文件。通常所有默认的xml布局文件都存储在系统路径中。在我的窗口C:\Users\NAVEEN\AppData\Local\Android\sdk1\platforms\android-22\data\res\layout
系统中。因此,您可以更改该xml内容并在应用中重复使用