Tag: 后退button

如何激活“共享”button在Android应用程序?

我想添加“分享”button到我的Android应用程序。 像那样 我添加了“分享”button,但button不活跃。 我点击,但没有任何反应。 我在MainActivity.java中的代码: private ShareActionProvider mShareActionProvider; @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.share_menu, menu); getMenuInflater().inflate(R.menu.main, menu); MenuItem item = menu.findItem(R.id.share_menu); mShareActionProvider = (ShareActionProvider) menu.findItem(R.id.share_menu).getActionProvider(); mShareActionProvider.setShareIntent(getDefaultShareIntent()); return true; } { Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("text/plain"); sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Text"); sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject"); startActivity(Intent.createChooser(sharingIntent, "Share using")); } 我想在我的第一个标签(first_tab.xml)或第二个标签(second_tab.xml)中共享文本。 选项卡中的代码(xml)(如果需要): <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/background_color" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" […]

调整浮动操作button(fab)的图标大小

新的浮动button应该是56dp x 56dp ,其中的图标应该是24dp x 24dp 。 所以图标和button之间的空间应该是16dp 。 <ImageButton android:id="@+id/fab_add" android:layout_width="56dp" android:layout_height="56dp" android:layout_gravity="bottom|right" android:layout_marginBottom="16dp" android:layout_marginRight="16dp" android:background="@drawable/ripple_oval" android:elevation="8dp" android:src="@drawable/ic_add_black_48dp" /> ripple_oval.xml <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:colorControlHighlight"> <item> <shape android:shape="oval"> <solid android:color="?android:colorAccent" /> </shape> </item> </ripple> 这是我得到的结果: 我使用了\ material-design-icons-1.0.0 \ content \ drawable-hdpi \ ic_add_black_48dp.png中的图标 https://github.com/google/material-design-icons/releases/tag/1.0.1 如何使button内的图标大小 完全按照指导原则进行描述? http://www.google.com/design/spec/components/buttons.html#buttons-floating-action-button

如何在宽度设置为“填充父项”的androidbutton中居中放置图标和文本

我想要一个带有图标+文本的Androidbutton。 我使用drawableLeft属性来设置图像,如果button的宽度是"wrap_content"但是我需要拉伸到最大宽度,所以我使用宽度"fill_parent" 。 这将我的图标直接移动到button的左侧,我希望图标和文本都位于button的中心。 我尝试设置填充,但这只允许给一个固定值,所以它不是我所需要的。 我需要在中心alignment图标+文本。 <Button android:id="@+id/startTelemoteButton" android:text="@string/start_telemote" android:drawableLeft="@drawable/start" android:paddingLeft="20dip" android:paddingRight="20dip" android:width="fill_parent" android:heigh="wrap_content" /> 任何build议,我怎么能实现呢?

如何删除Android中的button周围的填充?

在我的Android应用程序中,我有这样的布局: <?xml version="1.0" encoding="utf-8" ?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" class="com.google.android.gms.maps.SupportMapFragment"/> <Button android:id="@+id/button_back" android:layout_width="fill_parent" android:layout_height="wrap_content" android:onClick="CloseActivity" android:padding="0dp" android:text="@+string/back" /> </LinearLayout> 在预览和电话中,它看起来像: 正如你可以看到在底部区域的button,那里有一些填充。 我怎样才能摆脱这一点,并让button完全填充底部区域?

链接到“pin it”pinterest而不生成button

我有一个有数十或数百个post的页面,每个post都有社交button。 我只是不能生成每个url的所有button:它太慢(Facebook,G +,Twitter,pinterest …数百个链接)。 所以,而不是即时生成的Facebook分享button,我用一个简单的IMG指向 https://www.facebook.com/sharer.php?u=${url_of_current_post}&t= 当用户点击它时,会popup一个窗口,其中包含由facebook生成的内容。 我怎样才能做到这一点的Pinterest? 我只能find代码生成button,但我想尽可能避免js。 有没有像下面这样的东西? http://pinterest.com/pinthis?url=${url_of_current_post} 请不要试图让我使用jsbutton,谢谢。

造型twitter引导button

Twitter-Bootstrapbutton非常漂亮。 通过滚动它们来尝试它们 但是他们的颜色有限。 有没有什么办法可以改变button的基本颜色,同时保持漂亮的hover效果,引导使得如此美丽和轻松? 我完全不知道css / javascript看起来像twitter用来维护这些效果。

在iOS中更改button的文本并禁用button

你如何改变button的文本,并禁用iOS中的button?

Androiddevise库 – 浮动操作button填充/保证金问题

我正在使用Googledevise库中的新FloatingActionButton,我收到了一些奇怪的填充/边距问题。 这个图像(与开发人员的布局选项)来自API 22。 并从API 17。 这是XML <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_gravity="bottom|right" android:layout_marginLeft="16dp" android:layout_marginRight="20dp" android:layout_marginTop="-32dp" android:src="@drawable/ic_action_add" app:fabSize="normal" app:elevation="4dp" app:borderWidth="0dp" android:layout_below="@+id/header"/> 为什么API 17中的FAB有更大的填充/余量?

在单选button上使用“label for”

当在单选button上使用“label for”参数时,为了符合508, *是否正确? <label for="button one"><input type="radio" name="group1" id="r1" value="1" /> button one</label> 或者是这个? <input type="radio" name="group1" id="r1" value="1" /><label for="button one"> button one</label> 我想问的原因是,在第二个例子中,“标签”只包含文本而不是实际的单选button。 * 1973年“康复法”第508条要求联邦机构向残疾人提供软件和网站无障碍设施。

Androiddevise支持库可展开浮动操作button(FAB)菜单

现在,Androiddevise支持库已经出来了,有没有人知道如何实现扩展的Fab菜单,就像Inbox App上的fab? 应该是这样的: