我正在使用keyboardsurfer 的crouton库作为toasts 的替代品。我很好奇是否有一种简单的方法可以从而bottom
不是从action bar
. 我看了看,Configuration
但没有注意到任何对我有帮助的东西。
问问题
1237 次
2 回答
3
请参阅:https://github.com/keyboardsurfer/Crouton/issues/84 导致https://github.com/keyboardsurfer/Crouton/pull/132 导致https://github.com/keyboardsurfer/Crouton/问题/169 :(
简而言之:尚不可用,但您只需接受提议的拉取请求并将其格式化为新的 Android Studio 源代码树结构。
于 2014-07-26T23:15:42.487 回答
3
您可以在活动 xml 文件中创建一个空的 LinearView 并将其作为页脚。确保将其可见性设置为消失。如下所示:
<LinearLayout
android:id="@+id/croutonview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_gravity="bottom" >
</LinearLayout>
然后使用具有此线性视图资源 ID 的额外参数调用 crouton.makeText()。像这样的东西:
Crouton.makeText(this, "crouton message" de.keyboardsurfer.android.widget.crouton.Style.INFO,(ViewGroup)findViewById(R.id.croutonview)) .show();
希望能帮助到你!
于 2014-12-11T14:49:32.267 回答