我目前正在制作一个向后支持工具栏的应用程序,因此我有此文件
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
Run Code Online (Sandbox Code Playgroud)
然后,通过执行以下操作,以编程方式将其添加到视图中:
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
Run Code Online (Sandbox Code Playgroud)
但是,我希望能够将自定义视图(例如EditText和TextView)添加到工具栏中,而无需将其硬编码到上面的toolbar.xml中。
有什么办法吗?可能值得注意的是,我正在使用V7支持库。
谢谢利亚姆
我正在尝试使用mandrill api发送带有模板的电子邮件.我正在研究这里记录的方法:https://mandrillapp.com/api/docs/messages.php.html#method=send-template 代码在URL中实现:http://ezaccom.com/mxl.php 我的问题就是我的所有电子邮件都排队等候而不是按照他们应该的速度快速发送.这是代码(注意%TEMPLATE CODE%是我的电子邮件模板所在的位置):
try {
$mandrill = new Mandrill('API_KEY_REDACTED');
$template_name = 'Welcome mail on email /FB sign-up to very email id';
$template_content = array(
array(
'name' => 'Welcome mail on email /FB sign-up to very email id',
'content' => 'sign-up'
)
);
$message = array(
'html' => '%TEMPLATE CODE%',
'text' => 'Example text content',
'subject' => 'Welcome to Easyaccom',
'from_email' => 'hello@easyaccom.com',
'from_name' => 'Easyaccom',
'to' => array(
array(
'email' => 'RECIPIENT@gmail.com', …
Run Code Online (Sandbox Code Playgroud)