如何在我的 Android 应用程序中为按钮创建一个滑动条,就像 Evernote 中的滑动条一样,用于粗体、斜体、下划线等
How to create a sliding bar for buttons in my Android App like that of the Sliding bar in Evernote for Bold, Italics, Underline etc
Here is a link to the image of the Evernote app with the sliding bar at the bottom
我想出了我自己问题的答案。
这是代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button 1"/>
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button 2"/>
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button 3"/>
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button 4"/>
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button 5"/>
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button 6"/>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
Here is a link to the image of the Evernote app with the sliding bar at the bottom
我想出了我自己问题的答案。 这是代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button 1"/>
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button 2"/>
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button 3"/>
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button 4"/>
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button 5"/>
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Button 6"/>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>