android-layout

Why is there no gap between my two AlertDialog buttons?

自闭症网瘾萝莉.ら 提交于 2020-05-10 14:09:31
问题 In my AlertDialog, my Positive Button and Negative Button are "attached." I'm pretty sure there should be a gap between them. Can someone tell me why this is happening? I would be happy to provide any code. Here is what my AlertDialog looks like. I have a custom View for the Body as well as the Title of my AlertDialog (I won't post that XML code because I don't think it's necessary, but let me know.) In MainActivity, I inflate my custom title and body Views, and override setPositive() and

Why is there no gap between my two AlertDialog buttons?

微笑、不失礼 提交于 2020-05-10 14:07:05
问题 In my AlertDialog, my Positive Button and Negative Button are "attached." I'm pretty sure there should be a gap between them. Can someone tell me why this is happening? I would be happy to provide any code. Here is what my AlertDialog looks like. I have a custom View for the Body as well as the Title of my AlertDialog (I won't post that XML code because I don't think it's necessary, but let me know.) In MainActivity, I inflate my custom title and body Views, and override setPositive() and

Why is there no gap between my two AlertDialog buttons?

那年仲夏 提交于 2020-05-10 14:05:29
问题 In my AlertDialog, my Positive Button and Negative Button are "attached." I'm pretty sure there should be a gap between them. Can someone tell me why this is happening? I would be happy to provide any code. Here is what my AlertDialog looks like. I have a custom View for the Body as well as the Title of my AlertDialog (I won't post that XML code because I don't think it's necessary, but let me know.) In MainActivity, I inflate my custom title and body Views, and override setPositive() and

Using FragmentContainerView with Navigation component?

我怕爱的太早我们不能终老 提交于 2020-05-09 20:01:09
问题 After updating to Navigation 2.2.0-beta01 from the previous version, lint gives a warning about replacing the <fragment> tag with FragmentContainerView . However, replacing the tag alone seems to prevent the navigation graph from being inflated. According to 2.2.0-alpha01, FragmentContainerView is used internally. Should we ignore the lint warning? activity_main.xml <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent"> <!-

How do I prevent Android device Display size scaling in my app?

北慕城南 提交于 2020-05-09 05:18:47
问题 I'm developing an app with React Native for both iOS and Android, and I am trying to prevent device-specific scaling of the display in the app. For text/font size scaling, putting the following code in the root-level App.js file solves the issue for both iOS and Android: if (Text.defaultProps == null) { Text.defaultProps = {}; } Text.defaultProps.allowFontScaling = false; However, Android devices have the following Display size setting that is still being applied: I've tried (unsuccessfully)

setRecycledViewPool method in RecyclerView

无人久伴 提交于 2020-05-07 19:20:27
问题 I am trying to understand what the setRecycledViewPool method actually does along with the RecyclerView in the following line of code where mrecyclerView is a RecyclerView object: mrecyclerView.setRecycledViewPool(new RecyclerView.RecycledViewPool()); I read the Android documentation link and I still don't understand what it does clearly. Can someone explain to me its use and when to use it? 回答1: setRecycledViewPool(...) can be useful when we have a nested RecyclerView. See this blog post for

My recycler view is not showing any firebase images

给你一囗甜甜゛ 提交于 2020-05-04 10:55:33
问题 I am trying to retrieve data from the database to a recyclerview but the only name of an image is showing in the recyclerview. The image is not getting load in image . Here is my code and firebase images. fragmentHealthtips.java package com.example.bbeast.HomeActivity; import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.bumptech

Android image can't convert to drawable

大憨熊 提交于 2020-04-30 20:40:40
问题 I am not able to add image. I downloaded the image and added it to res directory under drawable-mdpi. Then when I try to add the image on the view using imageView, it gives me this error Couldn't resolve resource @drawable/ball01 Failed to convert @drawable/ball01 into a drawable Here is my xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_parent" android:layout

Android image can't convert to drawable

。_饼干妹妹 提交于 2020-04-30 20:33:08
问题 I am not able to add image. I downloaded the image and added it to res directory under drawable-mdpi. Then when I try to add the image on the view using imageView, it gives me this error Couldn't resolve resource @drawable/ball01 Failed to convert @drawable/ball01 into a drawable Here is my xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_parent" android:layout

landscape view and portrait view of webview in android

夙愿已清 提交于 2020-04-30 07:46:10
问题 im working on an android app and im dealing with a webview inside of my android app. i have two layout mainly the activitymain.xml found in layout folder and another layout named activitymain.xml found in layout-land folder and im loading these two from 1 java file but i need these two to load two different webview one for landscape and one for portrait.my question is is it possible to directly put the url/file path of my webview in xml so that when the user change orientation and the