custom-renderer

Xamarin Forms Android EntryCell Underline

给你一囗甜甜゛ 提交于 2019-12-24 17:33:37
问题 I need to remove the default underline as seen in this image EntryCell Example I have already created a custom Renderer for Android which is working fine on the device. I am able to color the EntryCells along with other UI tweaks. However I need to get rid of the line, I am using a placeholder to make it obvious that it is an EntryCell so I don't want the line to be visible. What needs to be added to achieve this using System; using System.ComponentModel; using Android.Content; using Android

Xamarin Forms Android EntryCell Underline

前提是你 提交于 2019-12-24 17:33:11
问题 I need to remove the default underline as seen in this image EntryCell Example I have already created a custom Renderer for Android which is working fine on the device. I am able to color the EntryCells along with other UI tweaks. However I need to get rid of the line, I am using a placeholder to make it obvious that it is an EntryCell so I don't want the line to be visible. What needs to be added to achieve this using System; using System.ComponentModel; using Android.Content; using Android

Border radius on Entry Xamarin Forms PCL

柔情痞子 提交于 2019-12-23 17:05:13
问题 Is there a way to set a border radius on an Entry in Xamarin's XAML, or by using a custom renderer or something ? Everything I've tried up to now has no effect, but for my application it would be really better if I had round borders. Thank you in advance for your answer ! PS : I've checked this post but I've not found my answer there :) 回答1: I think you can use a grid with 1 row and 1 column Inside the grid you can add your Entry and, for example, this control, in the same (the only) cell.

Xamarin.Forms: the MultiLineLabel doesn't longer work on Android

馋奶兔 提交于 2019-12-23 13:26:12
问题 On my Xamarin.Forms project, I use a MultiLineLabel to display a title on 1 or 2 lines, depending the text length. I'm based on this blog to achieve this. So I have a MultiLineLabel control: public class MultiLineLabel : Label { private static int _defaultLineSetting = -1; public static readonly BindableProperty LinesProperty = BindableProperty.Create(nameof(Lines), typeof(int), typeof(MultiLineLabel), _defaultLineSetting); public int Lines { get { return (int)GetValue(LinesProperty); } set {

CustomPicker Ok and Cancel buttons' color

不问归期 提交于 2019-12-20 05:26:14
问题 I have this custompicker class in android project: public class CustomPickerRenderer : PickerRenderer { private Context context; private IElementController ElementController => Element as IElementController; private AlertDialog _dialog; public CustomPickerRenderer(Context context) : base(context) { this.context = context; } protected override void OnElementChanged(ElementChangedEventArgs<Picker> e) { base.OnElementChanged(e); if (Control == null || e.NewElement == null) return; Control.Click

Custom JSF component: Using “startElement” with “script” results in a comment

≡放荡痞女 提交于 2019-12-19 10:48:20
问题 I'm rendering a custom JSF component. In the method encodeBegin I want to include some java script. public void encodeBegin(FacesContext context) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("script", this); writer.writeAttribute("type", "text/javascript", null); writer.writeText("var width=400",null); writer.endElement("script"); } When rendering the component the content of the script tag is commented out. <script type="text/javascript"><!--

Add ajax behaviour to JSF renderer

一曲冷凌霜 提交于 2019-12-13 05:26:39
问题 I have a custom JSF component renderer that renders pagination component for datatables, but it hasn't ajax behavior . I learned that it could be done by inserting ajax to encode method or by making support of f ajax tag. Unfortunately I'm not very familiar with ajax, so could you please tell me how I should modify this code to make it ajaxable? @FacesRenderer(componentFamily="javax.faces.Command", rendererType="com.component.Pager") public class PagerRenderer extends Renderer { private

JList with Image and text: Where text is coming from an ArrayList<String>

对着背影说爱祢 提交于 2019-12-13 00:56:37
问题 i have a simple example of a JList that is getting it's data from an ArrayList but i want to show an image next to each string in the list. I have written a custom cell renderer (IconListRenderer) that is suppose to display an icon and the object side-to-side. Here is a running sample. //Test class showing the list in a frame import java.awt.Color; import java.awt.Dimension; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import javax.swing.*; import javax.swing

Xamarin Custom ButtonRenderer Text under Image

▼魔方 西西 提交于 2019-12-12 01:50:59
问题 I am trying to place Label under the image inside a button and center it. I have a custom renderer for the button but for some reason I can not produce the desired output. The code is in C# Xamarin. XAML Code: <Controls:ExtendedButton VerticalOptions="EndAndExpand" HorizontalOptions="CenterAndExpand" x:Name="search" Text="Search" Image="Completed.png" IsEnabled="{Binding IsLoading}" Command="{Binding SearchCommand}" WidthRequest ="120" HeightRequest ="120" TextColor="#FFFFFF" > </Controls

Xamarin - Button with text and image in absolute layout results in mis-aligned elements

这一生的挚爱 提交于 2019-12-11 07:19:39
问题 I am trying to create a button in a Xamarin Forms cross-platform app (iOS and Android), where the button has both text and an image. The XAML is pretty straightforward: <AbsoluteLayout ...> <Labels and backgrounds and such> <Button x:Name="HomeButton2" TranslationX="6" TranslationY="100" BackgroundColor="#efeff4" TextColor="#4a4a4a" WidthRequest="58" HeightRequest="76" ContentLayout="Top,5" Image="TaskBar_Assets_HomeButtonIcon.png" Text="Home" Clicked="HomeButton_Clicked" /> </AbsoluteLayout>