标签: buttonbar

使用ButtonBar的RelativeLayout中的Android Scrollview

我正在尝试实现一个登录视图,其中多个EditTexts和一个徽标显示在屏幕上,底部有一个ButtonBar,如下所示:

alt text http://russellhaering.com/media/addAccount.png

问题是在非常小的屏幕上,特别是当它们侧向旋转时,整个主视图不适合屏幕.

我现在有

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#234C59"  >
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:paddingTop="5dip"
        android:paddingLeft="15dip"
        android:paddingRight="15dip"
        android:orientation="vertical" >
        <ImageView
            android:id="@+id/logo"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:scaleType="fitCenter"
            android:layout_centerHorizontal="true"
            android:src="@drawable/logo" />
        <EditText
            android:id="@+id/input_email"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dip"
            android:inputType="textEmailAddress"
            android:singleLine="true"
            android:hint="Username or email" />
        <EditText
            android:id="@+id/input_password"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop=""
            android:inputType="textPassword"
            android:singleLine="true"
            android:hint="Password" />
    </LinearLayout>
    <LinearLayout
        android:id="@+id/buttonbar_login"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal"
        style="@android:style/ButtonBar" >
        <Button
            android:id="@+id/button_signup"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Sign Up" />
        <Button
            android:id="@+id/button_login"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Log In" />
    </LinearLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

我已经尝试将第一个LinnearLayout封装在ScrollView中,如下所示:

<ScrollView …
Run Code Online (Sandbox Code Playgroud)

android scrollview relativelayout buttonbar

8
推荐指数
1
解决办法
1万
查看次数

自定义按钮栏中按钮之间的分隔符

我已经描述了一个自定义的按钮栏这里.

现在,我想在第一个和第二个之间以及第二个和第三个按钮之间添加一个分隔符.我的按钮栏定义如下:

<LinearLayout
            android:id="@+id/buttonBar"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/buttonbarstyle"
            android:layout_alignParentBottom="true"
            android:orientation="horizontal"
            >
            <ImageButton
                android:id="@+id/buttonBarImageButton1" 
                android:scaleType="centerInside"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/copy"
                android:padding="2dip"
                android:background="@drawable/buttonbar_background_selector"
                android:layout_gravity="center_vertical"
            />              
            <ImageButton 
                android:id="@+id/buttonBarImageButton2"
                android:scaleType="centerInside"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/options"
                android:padding="2dip"
                android:background="@drawable/buttonbar_background_selector"
                android:layout_gravity="center_vertical"
            />              
            <ImageButton
                android:id="@+id/buttonBarImageButton3" 
                android:scaleType="centerInside"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:layout_weight="1"
                android:src="@drawable/media_play"
                android:padding="2dip"
                android:background="@drawable/buttonbar_background_selector"
                android:layout_gravity="center_vertical"
            />              
        </LinearLayout>
Run Code Online (Sandbox Code Playgroud)

任务似乎很简单,但我找不到一个好方法.它应该在每个按钮之间有一个灰色的分隔符,所以它看起来有点像这样.

我相信这很简单,请指出我正确的方向.

android button separator togglebuttonbar buttonbar

6
推荐指数
2
解决办法
1万
查看次数

Android底部按钮栏和滚动视图,带有对话框主题

我正在尝试使用以下内容显示Android活动:

  • 对话主题;
  • 标题固定在对话框的顶部;
  • 一个固定在对话框底部的按钮栏;
  • 中间的滚动视图.

我编写的布局符合这些标准,但对话框始终填满整个屏幕(请参见底部的垂直屏幕截图).

这是我的布局:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content">

    <TextView android:id="@+id/header"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:layout_marginLeft="10dp" android:layout_marginRight="10dp"
    android:layout_marginTop="10dp" android:layout_marginBottom="10dp"
    android:gravity="center_vertical"
        android:textSize="18dip" android:textColor="#ffffff"
        android:text="Sample Layout" />

    <LinearLayout android:id="@+id/controls" android:orientation="horizontal"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    style="@android:style/ButtonBar">
        <Button android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:layout_weight="1" android:text="Yes" />
        <Button android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:layout_weight="1" android:text="No" />
    </LinearLayout>

    <ScrollView android:id="@+id/test" android:layout_below="@id/header"
    android:layout_above="@id/controls"
    android:layout_width="fill_parent" android:layout_height="wrap_content"
    android:layout_marginBottom="5dp" android:layout_marginLeft="5dp"
    android:layout_marginRight="5dp">
        <TextView android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:text="Lorem ipsum dolor sit amet, consectetur
        adipiscing elit. Integer dui odio, convallis vitae suscipit eu,
        tincidunt non mi. Vestibulum faucibus …
Run Code Online (Sandbox Code Playgroud)

android dialog scrollview buttonbar

5
推荐指数
1
解决办法
8788
查看次数

Flex移动应用程序中的样式ButtonBar字体 - 附带屏幕截图

我正在尝试使用以下代码在移动Flex应用程序的底部添加ButtonBar:

CSS:

@namespace s "library://ns.adobe.com/flex/spark";

s|ActionBar, s|ButtonBar {
    chromeColor: #0066CC;
    color: #FFFFFF;
    titleAlign: center;
}
Run Code Online (Sandbox Code Playgroud)

动作脚本:

<s:ButtonBar requireSelection="true" 
             width="100%" 
             bottom="0" 
             skinClass="spark.skins.mobile.TabbedViewNavigatorTabBarSkin">
    <s:ArrayCollection>
        <fx:Object label="???????" />
        <fx:Object label="????" icon="{MONEY}" />
        <fx:Object label="10" icon="{CALL}" />
    </s:ArrayCollection>
</s:ButtonBar>
Run Code Online (Sandbox Code Playgroud)

不幸的是,字体在按钮标签处看起来很凹凸或模糊(在下面的屏幕截图的底部):

在此输入图像描述

有谁知道,如何使ButtonBar标签字体再次成为常规

我无法找到CSS设置.

更新:我搜索了AIR SDK的源代码(像ButtonBase.as,Label.as,ButtonBarSkin.as等文件)但仍然无法找到答案.

所以我正在添加一个简化的测试用例+下面的一个截图以及这个问题的赏金.

在此输入图像描述

TestApp.mxml:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               applicationDPI="160">
    <fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";

        s|ActionBar, s|ButtonBar {
            chromeColor: #0066CC;
            color: #FFFFFF;
            titleAlign: center;
        }
    </fx:Style>

    <fx:Script>
        <![CDATA[
            import spark.events.IndexChangeEvent;
            import spark.skins.mobile.TabbedViewNavigatorTabBarSkin;

            private function handleTabs(event:IndexChangeEvent):void {
                _tabs[2].label …
Run Code Online (Sandbox Code Playgroud)

apache-flex flex4 buttonbar flex-mobile flex4.7

3
推荐指数
1
解决办法
1193
查看次数

从 jface 对话框中删除按钮栏

我想创建一个没有确定/取消按钮的对话框。我知道如果你重写 createButton 方法,这可以实现。

如果根本不需要按钮栏,您如何覆盖 createButtonBar 方法以返回 null?这将节省一些代码。

dialog jface buttonbar

0
推荐指数
1
解决办法
2151
查看次数