मैं एंड्रॉइड डिज़ाइन समर्थन लाइब्रेरी और टूलबार से नेविगेशन व्यू का उपयोग कर रहा हूं और सबकुछ ठीक काम करता है, लेकिन मैं जानना चाहता हूं कि हैमबर्गर आइकन को अंधेरा कैसे बनाया जाए (अभी यह सफेद दिखाई देता है)। इसके अलावा मैं स्क्रीन एज से एक्शनबार शीर्षक तक दूरी समायोजित करना चाहता हूं। फिर मेरे द्वारा इसे कैसे किया जाएगा? मदद के लिए धन्यवाद।मैं एक्शनबार हैमबर्गर आइकन का रंग कैसे बदलूं?
मैं विषय के रूप में थीम सेट करता हूं। AppCompat.Light.NoActionBar। तो मैं टूलबार का उपयोग करता हूं।
public class MainActivity extends AppCompatActivity {
//Defining Variables
private Toolbar toolbar;
private NavigationView navigationView;
private DrawerLayout drawerLayout;
ViewPager pager;
ViewPagerAdapter adapter;
SlidingTabLayout tabs;
CharSequence Titles[]={"Песни","Исполнители"};
int Numboftabs =2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Initializing Toolbar and setting it as the actionbar
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
और एक्सएमएल:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false"
tools:context=".MainActivity">
<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
>
<include
android:id="@+id/toolbar"
layout="@layout/tool_bar"
/>
<ru.amdm.amdm.SlidingTabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="2dp"
android:background="@color/ColorPrimary"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:foreground="?android:windowContentOverlay">
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_height="match_parent"
android:layout_width="match_parent"/>
</FrameLayout>
</LinearLayout>
<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_gravity="start"
app:headerLayout="@layout/header"
app:menu="@menu/drawer"
/>
क्या आप केवल एक्शनबार या टूलबार का उपयोग कर रहे हैं? कृपया अपना वर्तमान कोड पोस्ट करें। – hungryghost
@ हंगरीघोस्ट आपके संपादन के लिए धन्यवाद! – AlexKost