android-layout

how to set Linear layout child's height as tallest child height

梦想与她 提交于 2020-05-29 10:38:08
问题 I have four textviews in my Linear Layout and they have equal width as follows, <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/textView86" /> <LinearLayout android:orientation="horizontal" android:layout_width="match_parent"

Navigation drawer with bottom navigation

最后都变了- 提交于 2020-05-28 01:40:39
问题 In my application i want a navigation drawer with bottom navigation menu, but problem is that my container(content page) is overlapping the bottom navigation bar , i have attached my layout code with this question, please can anyone tell me what is wrong with the code? <?xml version="1.0" encoding="utf-8"?> <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:id="@

Camera2 API Make Preview Fill Entire View

坚强是说给别人听的谎言 提交于 2020-05-27 10:36:32
问题 I am using the Camera2Basic example from Google Samples (https://github.com/googlesamples/android-Camera2Basic) to display a camera preview inside a fragment. This fragment contains a RelativeLayout and a custom AutoFitTextureView. The latter can be found on the link above. I have adjusted the layout to center the preview and remove control buttons: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match

Camera2 API Make Preview Fill Entire View

半世苍凉 提交于 2020-05-27 10:34:29
问题 I am using the Camera2Basic example from Google Samples (https://github.com/googlesamples/android-Camera2Basic) to display a camera preview inside a fragment. This fragment contains a RelativeLayout and a custom AutoFitTextureView. The latter can be found on the link above. I have adjusted the layout to center the preview and remove control buttons: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match

Bottom Navigation View With Left Righ Space Issue

穿精又带淫゛_ 提交于 2020-05-26 19:26:19
问题 I am newbie in android, i am use bottom navigation view with two menus but im getting left right space Here is my Navigation View, <android.support.design.widget.BottomNavigationView android:id="@+id/bottom_navigation" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" app:itemBackground="@color/colorRed" app:itemIconTint="@color/colorWhite" app:itemTextColor="@color/colorWhite" app:menu="@menu/bottom_bar_menu"/> Please check Image

Bottom Navigation View With Left Righ Space Issue

六月ゝ 毕业季﹏ 提交于 2020-05-26 19:14:32
问题 I am newbie in android, i am use bottom navigation view with two menus but im getting left right space Here is my Navigation View, <android.support.design.widget.BottomNavigationView android:id="@+id/bottom_navigation" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" app:itemBackground="@color/colorRed" app:itemIconTint="@color/colorWhite" app:itemTextColor="@color/colorWhite" app:menu="@menu/bottom_bar_menu"/> Please check Image

Is there a tools attribute for ImageView content in Android?

时光怂恿深爱的人放手 提交于 2020-05-26 11:09:40
问题 I could not find a tools attribute to set an example image in a layout for Android. My assumption is that there is no such thing at the moment, at least no direct support. But I was wondering whether I just did not search well enough or whether there is a workaround for this. How do you define image placeholders at design time in Android with tools ? Example of a tools attribute for a TextView (i.e. the tools:text attribute for text): <TextView android:id="@+id/tv_vote_average" android:layout

How to put the android BottomAppBar with rounded corners

别等时光非礼了梦想. 提交于 2020-05-25 23:45:29
问题 I am using the BottomAppBar from google like this: <com.google.android.material.bottomappbar.BottomAppBar android:id="@+id/vNavigationBar" android:layout_width="match_parent" android:layout_height="wrap_content"> The custom bottom bar is flat and I need to add rounded corners on the Bottom bar(image example bellow) What should I do to make this work this way? 回答1: you can try add a shape drawable xml file and add the following code to it <corners android:topLeftRadius="16dp" android

how to replace/change image button programmatically android

≯℡__Kan透↙ 提交于 2020-05-25 04:34:27
问题 I have an image button on my view which i need to change after user interaction. I dont find nothing like myImageButton.setDrawable Here is my xml for the button i want to change: <ImageButton android:id="@+id/stopButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/buttons_background" android:layout_centerHorizontal="true" android:layout_marginTop="5dp" android:background="@null" android:src="@drawable/btn_play" /> The only line I

How to Activate GPS Icon in react-native?

最后都变了- 提交于 2020-05-24 05:45:12
问题 I want to appear GPS Icon on the status bar when I open app or screen that's contain Map, So I add a function that asks a user at the first time to allow Location permission and it's work very well and I can get Lat/Long but GPS "Location" Icon did not activate so how can I force an app to activate this icon? here's my Ask for permission function async requestLocationPermission() { try { const granted = await PermissionsAndroid.request( PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION, {