में कस्टम टूलबार बनाना मैं टूलबार में एक संपादन टेक्स्ट के साथ एंड्रॉइड में एक कस्टम विस्तारित टूलबार बनाने की कोशिश कर रहा हूं। लेआउट है कि मैं लागू करना चाहते हैं इसएंड्रॉइड
तरह दिखता कोड है कि मैं लागू करने के लिए लिखा है कुछ इस तरह है:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<android.support.v7.widget.Toolbar
android:id="@+id/my_awesome_toolbar"
android:layout_height="256dp"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/searchbox"
android:layout_alignParentBottom="true"
android:text="Test"
android:background="#ffffff"
/>
</android.support.v7.widget.Toolbar>
और गतिविधि निम्नलिखित है कोड
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowTitleEnabled(false);
getSupportActionBar().setDisplayShowHomeEnabled(false);
}}
लेकिन डब्ल्यू टोपी मुझे इसके बजाय मिलती है:
विस्तारित टूलबार को अनुकूलित करने के बारे में बहुत सारे ट्यूटोरियल नहीं हैं, इसलिए वास्तव में कुछ मदद की सराहना करेंगे।
हो सकता है कि यह आपकी मदद कर सकते हैं: http://stackoverflow.com/questions/31231609/creating -ए-बटन-इन-एंड्रॉइड-टूलबार/31477092 # 31477092 – Machado